From 36c4483e9fac4933fc024fcae24ae8fbbdb470a0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 25 Feb 2022 19:42:20 -0500 Subject: [PATCH 1/5] docs: add generated snippets (#336) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: https://github.com/googleapis/googleapis/commit/55b9e1e0b3106c850d13958352bc0751147b6b15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: use gapic-generator-python 0.63.4 chore: fix snippet region tag format chore: fix docstring code block formatting PiperOrigin-RevId: 430730865 Source-Link: https://github.com/googleapis/googleapis/commit/ea5800229f73f94fd7204915a86ed09dcddf429a Source-Link: https://github.com/googleapis/googleapis-gen/commit/ca893ff8af25fc7fe001de1405a517d80446ecca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2E4OTNmZjhhZjI1ZmM3ZmUwMDFkZTE0MDVhNTE3ZDgwNDQ2ZWNjYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> --- .../translation_service/async_client.py | 246 +++++ .../services/translation_service/client.py | 246 +++++ .../translation_service/async_client.py | 246 +++++ .../services/translation_service/client.py | 246 +++++ .../snippet_metadata_translate_v3.json | 894 ++++++++++++++++++ .../snippet_metadata_translate_v3beta1.json | 894 ++++++++++++++++++ ..._service_batch_translate_document_async.py | 59 ++ ...n_service_batch_translate_document_sync.py | 59 ++ ...tion_service_batch_translate_text_async.py | 59 ++ ...ation_service_batch_translate_text_sync.py | 59 ++ ...anslation_service_create_glossary_async.py | 53 ++ ...ranslation_service_create_glossary_sync.py | 53 ++ ...anslation_service_delete_glossary_async.py | 49 + ...ranslation_service_delete_glossary_sync.py | 49 + ...anslation_service_detect_language_async.py | 46 + ...ranslation_service_detect_language_sync.py | 46 + ..._translation_service_get_glossary_async.py | 45 + ...3_translation_service_get_glossary_sync.py | 45 + ...n_service_get_supported_languages_async.py | 45 + ...on_service_get_supported_languages_sync.py | 45 + ...anslation_service_list_glossaries_async.py | 46 + ...ranslation_service_list_glossaries_sync.py | 46 + ...lation_service_translate_document_async.py | 50 + ...slation_service_translate_document_sync.py | 50 + ...ranslation_service_translate_text_async.py | 47 + ...translation_service_translate_text_sync.py | 47 + ..._service_batch_translate_document_async.py | 59 ++ ...n_service_batch_translate_document_sync.py | 59 ++ ...tion_service_batch_translate_text_async.py | 59 ++ ...ation_service_batch_translate_text_sync.py | 59 ++ ...anslation_service_create_glossary_async.py | 53 ++ ...ranslation_service_create_glossary_sync.py | 53 ++ ...anslation_service_delete_glossary_async.py | 49 + ...ranslation_service_delete_glossary_sync.py | 49 + ...anslation_service_detect_language_async.py | 46 + ...ranslation_service_detect_language_sync.py | 46 + ..._translation_service_get_glossary_async.py | 45 + ...1_translation_service_get_glossary_sync.py | 45 + ...n_service_get_supported_languages_async.py | 45 + ...on_service_get_supported_languages_sync.py | 45 + ...anslation_service_list_glossaries_async.py | 46 + ...ranslation_service_list_glossaries_sync.py | 46 + ...lation_service_translate_document_async.py | 50 + ...slation_service_translate_document_sync.py | 50 + ...ranslation_service_translate_text_async.py | 47 + ...translation_service_translate_text_sync.py | 47 + ..._service_batch_translate_document_async.py | 59 ++ ...n_service_batch_translate_document_sync.py | 59 ++ ...tion_service_batch_translate_text_async.py | 59 ++ ...ation_service_batch_translate_text_sync.py | 59 ++ ...anslation_service_create_glossary_async.py | 53 ++ ...ranslation_service_create_glossary_sync.py | 53 ++ ...anslation_service_delete_glossary_async.py | 49 + ...ranslation_service_delete_glossary_sync.py | 49 + ...anslation_service_detect_language_async.py | 46 + ...ranslation_service_detect_language_sync.py | 46 + ..._translation_service_get_glossary_async.py | 45 + ...d_translation_service_get_glossary_sync.py | 45 + ...n_service_get_supported_languages_async.py | 45 + ...on_service_get_supported_languages_sync.py | 45 + ...anslation_service_list_glossaries_async.py | 46 + ...ranslation_service_list_glossaries_sync.py | 46 + ...lation_service_translate_document_async.py | 50 + ...slation_service_translate_document_sync.py | 50 + ...ranslation_service_translate_text_async.py | 47 + ...translation_service_translate_text_sync.py | 47 + ..._service_batch_translate_document_async.py | 59 ++ ...n_service_batch_translate_document_sync.py | 59 ++ ...tion_service_batch_translate_text_async.py | 59 ++ ...ation_service_batch_translate_text_sync.py | 59 ++ ...anslation_service_create_glossary_async.py | 53 ++ ...ranslation_service_create_glossary_sync.py | 53 ++ ...anslation_service_delete_glossary_async.py | 49 + ...ranslation_service_delete_glossary_sync.py | 49 + ...anslation_service_detect_language_async.py | 46 + ...ranslation_service_detect_language_sync.py | 46 + ..._translation_service_get_glossary_async.py | 45 + ...d_translation_service_get_glossary_sync.py | 45 + ...n_service_get_supported_languages_async.py | 45 + ...on_service_get_supported_languages_sync.py | 45 + ...anslation_service_list_glossaries_async.py | 46 + ...ranslation_service_list_glossaries_sync.py | 46 + ...lation_service_translate_document_async.py | 50 + ...slation_service_translate_document_sync.py | 50 + ...ranslation_service_translate_text_async.py | 47 + ...translation_service_translate_text_sync.py | 47 + 86 files changed, 6764 insertions(+) create mode 100644 samples/generated_samples/snippet_metadata_translate_v3.json create mode 100644 samples/generated_samples/snippet_metadata_translate_v3beta1.json create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_sync.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_async.py create mode 100644 samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py create mode 100644 samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py create mode 100644 samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py diff --git a/google/cloud/translate_v3/services/translation_service/async_client.py b/google/cloud/translate_v3/services/translation_service/async_client.py index f1fa93b9..c3651e91 100644 --- a/google/cloud/translate_v3/services/translation_service/async_client.py +++ b/google/cloud/translate_v3/services/translation_service/async_client.py @@ -222,6 +222,27 @@ async def translate_text( ) -> translation_service.TranslateTextResponse: r"""Translates input text and returns translated text. + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.TranslateTextRequest, dict]): The request object. The request message for synchronous @@ -390,6 +411,26 @@ async def detect_language( ) -> translation_service.DetectLanguageResponse: r"""Detects the language of text within a request. + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_detect_language(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.DetectLanguageRequest, dict]): The request object. The request message for language @@ -513,6 +554,26 @@ async def get_supported_languages( r"""Returns a list of supported languages for translation. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_get_supported_languages(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.GetSupportedLanguagesRequest, dict]): The request object. The request message for discovering @@ -638,6 +699,30 @@ async def translate_document( ) -> translation_service.TranslateDocumentResponse: r"""Translates documents in synchronous mode. + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.TranslateDocumentRequest, dict]): The request object. A document translation request. @@ -694,6 +779,40 @@ async def batch_translate_text( use google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_batch_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.BatchTranslateTextRequest, dict]): The request object. The batch translation request. @@ -767,6 +886,40 @@ async def batch_translate_document( google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_batch_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.BatchTranslateDocumentRequest, dict]): The request object. The BatchTranslateDocument request. @@ -917,6 +1070,34 @@ async def create_glossary( r"""Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_create_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3.Glossary() + glossary.name = "name_value" + + request = translate_v3.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.CreateGlossaryRequest, dict]): The request object. Request message for CreateGlossary. @@ -1004,6 +1185,27 @@ async def list_glossaries( r"""Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_list_glossaries(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.translate_v3.types.ListGlossariesRequest, dict]): The request object. Request message for ListGlossaries. @@ -1094,6 +1296,26 @@ async def get_glossary( r"""Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_get_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.GetGlossaryRequest, dict]): The request object. Request message for GetGlossary. @@ -1176,6 +1398,30 @@ async def delete_glossary( glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_delete_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.DeleteGlossaryRequest, dict]): The request object. Request message for DeleteGlossary. diff --git a/google/cloud/translate_v3/services/translation_service/client.py b/google/cloud/translate_v3/services/translation_service/client.py index 420622d7..ec0eff50 100644 --- a/google/cloud/translate_v3/services/translation_service/client.py +++ b/google/cloud/translate_v3/services/translation_service/client.py @@ -420,6 +420,27 @@ def translate_text( ) -> translation_service.TranslateTextResponse: r"""Translates input text and returns translated text. + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.TranslateTextRequest, dict]): The request object. The request message for synchronous @@ -588,6 +609,26 @@ def detect_language( ) -> translation_service.DetectLanguageResponse: r"""Detects the language of text within a request. + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_detect_language(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.DetectLanguageRequest, dict]): The request object. The request message for language @@ -711,6 +752,26 @@ def get_supported_languages( r"""Returns a list of supported languages for translation. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_get_supported_languages(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.GetSupportedLanguagesRequest, dict]): The request object. The request message for discovering @@ -826,6 +887,30 @@ def translate_document( ) -> translation_service.TranslateDocumentResponse: r"""Translates documents in synchronous mode. + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.TranslateDocumentRequest, dict]): The request object. A document translation request. @@ -883,6 +968,40 @@ def batch_translate_text( use google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_batch_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.BatchTranslateTextRequest, dict]): The request object. The batch translation request. @@ -957,6 +1076,40 @@ def batch_translate_document( google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_batch_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.BatchTranslateDocumentRequest, dict]): The request object. The BatchTranslateDocument request. @@ -1107,6 +1260,34 @@ def create_glossary( r"""Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_create_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3.Glossary() + glossary.name = "name_value" + + request = translate_v3.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.CreateGlossaryRequest, dict]): The request object. Request message for CreateGlossary. @@ -1194,6 +1375,27 @@ def list_glossaries( r"""Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_list_glossaries(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.translate_v3.types.ListGlossariesRequest, dict]): The request object. Request message for ListGlossaries. @@ -1274,6 +1476,26 @@ def get_glossary( r"""Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_get_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.GetGlossaryRequest, dict]): The request object. Request message for GetGlossary. @@ -1346,6 +1568,30 @@ def delete_glossary( glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3 + + def sample_delete_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3.types.DeleteGlossaryRequest, dict]): The request object. Request message for DeleteGlossary. diff --git a/google/cloud/translate_v3beta1/services/translation_service/async_client.py b/google/cloud/translate_v3beta1/services/translation_service/async_client.py index 8c8c2eeb..49c9cb95 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/async_client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/async_client.py @@ -216,6 +216,27 @@ async def translate_text( ) -> translation_service.TranslateTextResponse: r"""Translates input text and returns translated text. + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.TranslateTextRequest, dict]): The request object. The request message for synchronous @@ -266,6 +287,26 @@ async def detect_language( ) -> translation_service.DetectLanguageResponse: r"""Detects the language of text within a request. + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_detect_language(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.DetectLanguageRequest, dict]): The request object. The request message for language @@ -380,6 +421,26 @@ async def get_supported_languages( r"""Returns a list of supported languages for translation. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_get_supported_languages(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.GetSupportedLanguagesRequest, dict]): The request object. The request message for discovering @@ -505,6 +566,30 @@ async def translate_document( ) -> translation_service.TranslateDocumentResponse: r"""Translates documents in synchronous mode. + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3beta1.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3beta1.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.TranslateDocumentRequest, dict]): The request object. A document translation request. @@ -561,6 +646,40 @@ async def batch_translate_text( use google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_batch_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.BatchTranslateTextRequest, dict]): The request object. The batch translation request. @@ -634,6 +753,40 @@ async def batch_translate_document( google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_batch_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.BatchTranslateDocumentRequest, dict]): The request object. The BatchTranslateDocument request. @@ -784,6 +937,34 @@ async def create_glossary( r"""Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_create_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3beta1.Glossary() + glossary.name = "name_value" + + request = translate_v3beta1.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.CreateGlossaryRequest, dict]): The request object. Request message for CreateGlossary. @@ -872,6 +1053,27 @@ async def list_glossaries( r"""Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_list_glossaries(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.ListGlossariesRequest, dict]): The request object. Request message for ListGlossaries. @@ -998,6 +1200,26 @@ async def get_glossary( r"""Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_get_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.GetGlossaryRequest, dict]): The request object. Request message for GetGlossary. @@ -1080,6 +1302,30 @@ async def delete_glossary( glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_delete_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.DeleteGlossaryRequest, dict]): The request object. Request message for DeleteGlossary. diff --git a/google/cloud/translate_v3beta1/services/translation_service/client.py b/google/cloud/translate_v3beta1/services/translation_service/client.py index 2fb395cb..32d4024c 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/client.py @@ -414,6 +414,27 @@ def translate_text( ) -> translation_service.TranslateTextResponse: r"""Translates input text and returns translated text. + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.TranslateTextRequest, dict]): The request object. The request message for synchronous @@ -465,6 +486,26 @@ def detect_language( ) -> translation_service.DetectLanguageResponse: r"""Detects the language of text within a request. + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_detect_language(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.DetectLanguageRequest, dict]): The request object. The request message for language @@ -579,6 +620,26 @@ def get_supported_languages( r"""Returns a list of supported languages for translation. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_get_supported_languages(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.GetSupportedLanguagesRequest, dict]): The request object. The request message for discovering @@ -694,6 +755,30 @@ def translate_document( ) -> translation_service.TranslateDocumentResponse: r"""Translates documents in synchronous mode. + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3beta1.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3beta1.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.TranslateDocumentRequest, dict]): The request object. A document translation request. @@ -751,6 +836,40 @@ def batch_translate_text( use google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_batch_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.BatchTranslateTextRequest, dict]): The request object. The batch translation request. @@ -825,6 +944,40 @@ def batch_translate_document( google.longrunning.Operation.name to poll the status of the call. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_batch_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.BatchTranslateDocumentRequest, dict]): The request object. The BatchTranslateDocument request. @@ -975,6 +1128,34 @@ def create_glossary( r"""Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_create_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3beta1.Glossary() + glossary.name = "name_value" + + request = translate_v3beta1.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.CreateGlossaryRequest, dict]): The request object. Request message for CreateGlossary. @@ -1063,6 +1244,27 @@ def list_glossaries( r"""Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_list_glossaries(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.ListGlossariesRequest, dict]): The request object. Request message for ListGlossaries. @@ -1179,6 +1381,26 @@ def get_glossary( r"""Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_get_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.GetGlossaryRequest, dict]): The request object. Request message for GetGlossary. @@ -1251,6 +1473,30 @@ def delete_glossary( glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. + + .. code-block:: python + + from google.cloud import translate_v3beta1 + + def sample_delete_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.translate_v3beta1.types.DeleteGlossaryRequest, dict]): The request object. Request message for DeleteGlossary. diff --git a/samples/generated_samples/snippet_metadata_translate_v3.json b/samples/generated_samples/snippet_metadata_translate_v3.json new file mode 100644 index 00000000..32c166f1 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_translate_v3.json @@ -0,0 +1,894 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateDocument" + } + }, + "file": "translate_v3_generated_translation_service_batch_translate_document_async.py", + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateDocument_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateDocument" + } + }, + "file": "translate_v3_generated_translation_service_batch_translate_document_sync.py", + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateDocument_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateText" + } + }, + "file": "translate_v3_generated_translation_service_batch_translate_text_async.py", + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateText_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateText" + } + }, + "file": "translate_v3_generated_translation_service_batch_translate_text_sync.py", + "regionTag": "translate_v3_generated_TranslationService_BatchTranslateText_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "CreateGlossary" + } + }, + "file": "translate_v3_generated_translation_service_create_glossary_async.py", + "regionTag": "translate_v3_generated_TranslationService_CreateGlossary_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "CreateGlossary" + } + }, + "file": "translate_v3_generated_translation_service_create_glossary_sync.py", + "regionTag": "translate_v3_generated_TranslationService_CreateGlossary_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DeleteGlossary" + } + }, + "file": "translate_v3_generated_translation_service_delete_glossary_async.py", + "regionTag": "translate_v3_generated_TranslationService_DeleteGlossary_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DeleteGlossary" + } + }, + "file": "translate_v3_generated_translation_service_delete_glossary_sync.py", + "regionTag": "translate_v3_generated_TranslationService_DeleteGlossary_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DetectLanguage" + } + }, + "file": "translate_v3_generated_translation_service_detect_language_async.py", + "regionTag": "translate_v3_generated_TranslationService_DetectLanguage_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DetectLanguage" + } + }, + "file": "translate_v3_generated_translation_service_detect_language_sync.py", + "regionTag": "translate_v3_generated_TranslationService_DetectLanguage_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetGlossary" + } + }, + "file": "translate_v3_generated_translation_service_get_glossary_async.py", + "regionTag": "translate_v3_generated_TranslationService_GetGlossary_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetGlossary" + } + }, + "file": "translate_v3_generated_translation_service_get_glossary_sync.py", + "regionTag": "translate_v3_generated_TranslationService_GetGlossary_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetSupportedLanguages" + } + }, + "file": "translate_v3_generated_translation_service_get_supported_languages_async.py", + "regionTag": "translate_v3_generated_TranslationService_GetSupportedLanguages_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetSupportedLanguages" + } + }, + "file": "translate_v3_generated_translation_service_get_supported_languages_sync.py", + "regionTag": "translate_v3_generated_TranslationService_GetSupportedLanguages_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "ListGlossaries" + } + }, + "file": "translate_v3_generated_translation_service_list_glossaries_async.py", + "regionTag": "translate_v3_generated_TranslationService_ListGlossaries_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "ListGlossaries" + } + }, + "file": "translate_v3_generated_translation_service_list_glossaries_sync.py", + "regionTag": "translate_v3_generated_TranslationService_ListGlossaries_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateDocument" + } + }, + "file": "translate_v3_generated_translation_service_translate_document_async.py", + "regionTag": "translate_v3_generated_TranslationService_TranslateDocument_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateDocument" + } + }, + "file": "translate_v3_generated_translation_service_translate_document_sync.py", + "regionTag": "translate_v3_generated_TranslationService_TranslateDocument_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateText" + } + }, + "file": "translate_v3_generated_translation_service_translate_text_async.py", + "regionTag": "translate_v3_generated_TranslationService_TranslateText_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateText" + } + }, + "file": "translate_v3_generated_translation_service_translate_text_sync.py", + "regionTag": "translate_v3_generated_TranslationService_TranslateText_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_translate_v3beta1.json b/samples/generated_samples/snippet_metadata_translate_v3beta1.json new file mode 100644 index 00000000..537673e5 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_translate_v3beta1.json @@ -0,0 +1,894 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateDocument" + } + }, + "file": "translate_v3beta1_generated_translation_service_batch_translate_document_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateDocument" + } + }, + "file": "translate_v3beta1_generated_translation_service_batch_translate_document_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateDocument_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateText" + } + }, + "file": "translate_v3beta1_generated_translation_service_batch_translate_text_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateText_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "BatchTranslateText" + } + }, + "file": "translate_v3beta1_generated_translation_service_batch_translate_text_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_BatchTranslateText_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "CreateGlossary" + } + }, + "file": "translate_v3beta1_generated_translation_service_create_glossary_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_CreateGlossary_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "CreateGlossary" + } + }, + "file": "translate_v3beta1_generated_translation_service_create_glossary_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_CreateGlossary_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DeleteGlossary" + } + }, + "file": "translate_v3beta1_generated_translation_service_delete_glossary_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_DeleteGlossary_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DeleteGlossary" + } + }, + "file": "translate_v3beta1_generated_translation_service_delete_glossary_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_DeleteGlossary_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DetectLanguage" + } + }, + "file": "translate_v3beta1_generated_translation_service_detect_language_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_DetectLanguage_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "DetectLanguage" + } + }, + "file": "translate_v3beta1_generated_translation_service_detect_language_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_DetectLanguage_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetGlossary" + } + }, + "file": "translate_v3beta1_generated_translation_service_get_glossary_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_GetGlossary_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetGlossary" + } + }, + "file": "translate_v3beta1_generated_translation_service_get_glossary_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_GetGlossary_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetSupportedLanguages" + } + }, + "file": "translate_v3beta1_generated_translation_service_get_supported_languages_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "GetSupportedLanguages" + } + }, + "file": "translate_v3beta1_generated_translation_service_get_supported_languages_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_GetSupportedLanguages_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "ListGlossaries" + } + }, + "file": "translate_v3beta1_generated_translation_service_list_glossaries_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_ListGlossaries_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "ListGlossaries" + } + }, + "file": "translate_v3beta1_generated_translation_service_list_glossaries_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_ListGlossaries_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateDocument" + } + }, + "file": "translate_v3beta1_generated_translation_service_translate_document_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateDocument_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateDocument" + } + }, + "file": "translate_v3beta1_generated_translation_service_translate_document_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateDocument_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateText" + } + }, + "file": "translate_v3beta1_generated_translation_service_translate_text_async.py", + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateText_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "TranslationService" + }, + "shortName": "TranslateText" + } + }, + "file": "translate_v3beta1_generated_translation_service_translate_text_sync.py", + "regionTag": "translate_v3beta1_generated_TranslationService_TranslateText_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_async.py new file mode 100644 index 00000000..a43e5e4e --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_BatchTranslateDocument_async] +from google.cloud import translate_v3 + + +async def sample_batch_translate_document(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_BatchTranslateDocument_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_sync.py new file mode 100644 index 00000000..bf358856 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_document_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_BatchTranslateDocument_sync] +from google.cloud import translate_v3 + + +def sample_batch_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_BatchTranslateDocument_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_async.py new file mode 100644 index 00000000..431f7edf --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_BatchTranslateText_async] +from google.cloud import translate_v3 + + +async def sample_batch_translate_text(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_BatchTranslateText_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_sync.py new file mode 100644 index 00000000..68f8b1ff --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_batch_translate_text_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_BatchTranslateText_sync] +from google.cloud import translate_v3 + + +def sample_batch_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_BatchTranslateText_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_async.py new file mode 100644 index 00000000..a407ed46 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_CreateGlossary_async] +from google.cloud import translate_v3 + + +async def sample_create_glossary(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + glossary = translate_v3.Glossary() + glossary.name = "name_value" + + request = translate_v3.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_CreateGlossary_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_sync.py new file mode 100644 index 00000000..68fcc191 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_create_glossary_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_CreateGlossary_sync] +from google.cloud import translate_v3 + + +def sample_create_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3.Glossary() + glossary.name = "name_value" + + request = translate_v3.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_CreateGlossary_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_async.py new file mode 100644 index 00000000..9e859d68 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_DeleteGlossary_async] +from google.cloud import translate_v3 + + +async def sample_delete_glossary(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_DeleteGlossary_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_sync.py new file mode 100644 index 00000000..e397a1bd --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_delete_glossary_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_DeleteGlossary_sync] +from google.cloud import translate_v3 + + +def sample_delete_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_DeleteGlossary_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_async.py new file mode 100644 index 00000000..3539d116 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_DetectLanguage_async] +from google.cloud import translate_v3 + + +async def sample_detect_language(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = await client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_DetectLanguage_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_sync.py new file mode 100644 index 00000000..5f76924c --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_detect_language_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_DetectLanguage_sync] +from google.cloud import translate_v3 + + +def sample_detect_language(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_DetectLanguage_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_async.py new file mode 100644 index 00000000..ffd2fd34 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_GetGlossary_async] +from google.cloud import translate_v3 + + +async def sample_get_glossary(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_GetGlossary_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_sync.py new file mode 100644 index 00000000..751b4dad --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_glossary_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_GetGlossary_sync] +from google.cloud import translate_v3 + + +def sample_get_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_GetGlossary_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_async.py new file mode 100644 index 00000000..279fe4fd --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_GetSupportedLanguages_async] +from google.cloud import translate_v3 + + +async def sample_get_supported_languages(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_GetSupportedLanguages_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_sync.py new file mode 100644 index 00000000..378d3328 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_get_supported_languages_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_GetSupportedLanguages_sync] +from google.cloud import translate_v3 + + +def sample_get_supported_languages(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_GetSupportedLanguages_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_async.py new file mode 100644 index 00000000..30ea3da6 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_ListGlossaries_async] +from google.cloud import translate_v3 + + +async def sample_list_glossaries(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END translate_generated_translate_v3_TranslationService_ListGlossaries_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_sync.py new file mode 100644 index 00000000..3b67db9b --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_list_glossaries_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_ListGlossaries_sync] +from google.cloud import translate_v3 + + +def sample_list_glossaries(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END translate_generated_translate_v3_TranslationService_ListGlossaries_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_async.py new file mode 100644 index 00000000..533078a9 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_TranslateDocument_async] +from google.cloud import translate_v3 + + +async def sample_translate_document(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + document_input_config = translate_v3.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = await client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_TranslateDocument_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_sync.py new file mode 100644 index 00000000..b6f4c1a9 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_document_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_TranslateDocument_sync] +from google.cloud import translate_v3 + + +def sample_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_TranslateDocument_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_async.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_async.py new file mode 100644 index 00000000..8d20de78 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_TranslateText_async] +from google.cloud import translate_v3 + + +async def sample_translate_text(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = await client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_TranslateText_async] diff --git a/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_sync.py b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_sync.py new file mode 100644 index 00000000..458d11cd --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3_translation_service_translate_text_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3_TranslationService_TranslateText_sync] +from google.cloud import translate_v3 + + +def sample_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3_TranslationService_TranslateText_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_async.py new file mode 100644 index 00000000..60bb5b44 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_BatchTranslateDocument_async] +from google.cloud import translate_v3beta1 + + +async def sample_batch_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_BatchTranslateDocument_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_sync.py new file mode 100644 index 00000000..c8095f57 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_document_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_BatchTranslateDocument_sync] +from google.cloud import translate_v3beta1 + + +def sample_batch_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_BatchTranslateDocument_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_async.py new file mode 100644 index 00000000..b3406405 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_BatchTranslateText_async] +from google.cloud import translate_v3beta1 + + +async def sample_batch_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_BatchTranslateText_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_sync.py new file mode 100644 index 00000000..ab674d3d --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_batch_translate_text_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_BatchTranslateText_sync] +from google.cloud import translate_v3beta1 + + +def sample_batch_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_BatchTranslateText_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_async.py new file mode 100644 index 00000000..548c6439 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_CreateGlossary_async] +from google.cloud import translate_v3beta1 + + +async def sample_create_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + glossary = translate_v3beta1.Glossary() + glossary.name = "name_value" + + request = translate_v3beta1.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_CreateGlossary_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_sync.py new file mode 100644 index 00000000..9898c15e --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_create_glossary_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_CreateGlossary_sync] +from google.cloud import translate_v3beta1 + + +def sample_create_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3beta1.Glossary() + glossary.name = "name_value" + + request = translate_v3beta1.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_CreateGlossary_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_async.py new file mode 100644 index 00000000..09de10c8 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_DeleteGlossary_async] +from google.cloud import translate_v3beta1 + + +async def sample_delete_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_DeleteGlossary_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_sync.py new file mode 100644 index 00000000..fca8fca2 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_delete_glossary_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_DeleteGlossary_sync] +from google.cloud import translate_v3beta1 + + +def sample_delete_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_DeleteGlossary_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_async.py new file mode 100644 index 00000000..021bde2e --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_DetectLanguage_async] +from google.cloud import translate_v3beta1 + + +async def sample_detect_language(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = await client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_DetectLanguage_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_sync.py new file mode 100644 index 00000000..5d88e95b --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_detect_language_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_DetectLanguage_sync] +from google.cloud import translate_v3beta1 + + +def sample_detect_language(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_DetectLanguage_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_async.py new file mode 100644 index 00000000..50363956 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_GetGlossary_async] +from google.cloud import translate_v3beta1 + + +async def sample_get_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_GetGlossary_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_sync.py new file mode 100644 index 00000000..8160d982 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_glossary_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_GetGlossary_sync] +from google.cloud import translate_v3beta1 + + +def sample_get_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_GetGlossary_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_async.py new file mode 100644 index 00000000..641f6bed --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_GetSupportedLanguages_async] +from google.cloud import translate_v3beta1 + + +async def sample_get_supported_languages(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_GetSupportedLanguages_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_sync.py new file mode 100644 index 00000000..4f5aef8f --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_get_supported_languages_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_GetSupportedLanguages_sync] +from google.cloud import translate_v3beta1 + + +def sample_get_supported_languages(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_GetSupportedLanguages_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_async.py new file mode 100644 index 00000000..f1a9688c --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_ListGlossaries_async] +from google.cloud import translate_v3beta1 + + +async def sample_list_glossaries(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_ListGlossaries_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_sync.py new file mode 100644 index 00000000..d2a81dee --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_list_glossaries_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_ListGlossaries_sync] +from google.cloud import translate_v3beta1 + + +def sample_list_glossaries(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_ListGlossaries_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_async.py new file mode 100644 index 00000000..0593c6da --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_TranslateDocument_async] +from google.cloud import translate_v3beta1 + + +async def sample_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + document_input_config = translate_v3beta1.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3beta1.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = await client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_TranslateDocument_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_sync.py new file mode 100644 index 00000000..2deac12a --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_document_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_TranslateDocument_sync] +from google.cloud import translate_v3beta1 + + +def sample_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3beta1.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3beta1.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_TranslateDocument_sync] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_async.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_async.py new file mode 100644 index 00000000..5228dc9a --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_TranslateText_async] +from google.cloud import translate_v3beta1 + + +async def sample_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = await client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_TranslateText_async] diff --git a/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_sync.py b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_sync.py new file mode 100644 index 00000000..d24cc2f2 --- /dev/null +++ b/samples/generated_samples/translate_generated_translate_v3beta1_translation_service_translate_text_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_generated_translate_v3beta1_TranslationService_TranslateText_sync] +from google.cloud import translate_v3beta1 + + +def sample_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_generated_translate_v3beta1_TranslationService_TranslateText_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py new file mode 100644 index 00000000..61d5255a --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_BatchTranslateDocument_async] +from google.cloud import translate_v3 + + +async def sample_batch_translate_document(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_BatchTranslateDocument_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py new file mode 100644 index 00000000..fe994910 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_BatchTranslateDocument_sync] +from google.cloud import translate_v3 + + +def sample_batch_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_BatchTranslateDocument_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py new file mode 100644 index 00000000..79b23f33 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_BatchTranslateText_async] +from google.cloud import translate_v3 + + +async def sample_batch_translate_text(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_BatchTranslateText_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py new file mode 100644 index 00000000..99a45b93 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_BatchTranslateText_sync] +from google.cloud import translate_v3 + + +def sample_batch_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_BatchTranslateText_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py new file mode 100644 index 00000000..bb195816 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_CreateGlossary_async] +from google.cloud import translate_v3 + + +async def sample_create_glossary(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + glossary = translate_v3.Glossary() + glossary.name = "name_value" + + request = translate_v3.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_CreateGlossary_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py new file mode 100644 index 00000000..e99fca04 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_CreateGlossary_sync] +from google.cloud import translate_v3 + + +def sample_create_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3.Glossary() + glossary.name = "name_value" + + request = translate_v3.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_CreateGlossary_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py new file mode 100644 index 00000000..99b02b8e --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_DeleteGlossary_async] +from google.cloud import translate_v3 + + +async def sample_delete_glossary(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_DeleteGlossary_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py new file mode 100644 index 00000000..8691e1b0 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_DeleteGlossary_sync] +from google.cloud import translate_v3 + + +def sample_delete_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_DeleteGlossary_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py new file mode 100644 index 00000000..3eff2228 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_DetectLanguage_async] +from google.cloud import translate_v3 + + +async def sample_detect_language(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = await client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_DetectLanguage_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py new file mode 100644 index 00000000..fd1b85e2 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_DetectLanguage_sync] +from google.cloud import translate_v3 + + +def sample_detect_language(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_DetectLanguage_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py new file mode 100644 index 00000000..2274c719 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_GetGlossary_async] +from google.cloud import translate_v3 + + +async def sample_get_glossary(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_GetGlossary_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py new file mode 100644 index 00000000..e11c7ed7 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_GetGlossary_sync] +from google.cloud import translate_v3 + + +def sample_get_glossary(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_GetGlossary_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py new file mode 100644 index 00000000..2bf9d688 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_GetSupportedLanguages_async] +from google.cloud import translate_v3 + + +async def sample_get_supported_languages(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_GetSupportedLanguages_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py new file mode 100644 index 00000000..d23a8aca --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_GetSupportedLanguages_sync] +from google.cloud import translate_v3 + + +def sample_get_supported_languages(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_GetSupportedLanguages_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py new file mode 100644 index 00000000..d3616f0f --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_ListGlossaries_async] +from google.cloud import translate_v3 + + +async def sample_list_glossaries(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END translate_v3_generated_TranslationService_ListGlossaries_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py new file mode 100644 index 00000000..4e3dfa7b --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_ListGlossaries_sync] +from google.cloud import translate_v3 + + +def sample_list_glossaries(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END translate_v3_generated_TranslationService_ListGlossaries_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py new file mode 100644 index 00000000..9c1902a8 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_TranslateDocument_async] +from google.cloud import translate_v3 + + +async def sample_translate_document(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + document_input_config = translate_v3.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = await client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_TranslateDocument_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py new file mode 100644 index 00000000..f5a301d3 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_TranslateDocument_sync] +from google.cloud import translate_v3 + + +def sample_translate_document(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_TranslateDocument_sync] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py new file mode 100644 index 00000000..afe0e253 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_TranslateText_async] +from google.cloud import translate_v3 + + +async def sample_translate_text(): + # Create a client + client = translate_v3.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = await client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_TranslateText_async] diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py new file mode 100644 index 00000000..45fc51c5 --- /dev/null +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3_generated_TranslationService_TranslateText_sync] +from google.cloud import translate_v3 + + +def sample_translate_text(): + # Create a client + client = translate_v3.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_v3_generated_TranslationService_TranslateText_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py new file mode 100644 index 00000000..b062bac5 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] +from google.cloud import translate_v3beta1 + + +async def sample_batch_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py new file mode 100644 index 00000000..0bc01520 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_BatchTranslateDocument_sync] +from google.cloud import translate_v3beta1 + + +def sample_batch_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.BatchDocumentInputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.BatchDocumentOutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateDocumentRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_BatchTranslateDocument_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py new file mode 100644 index 00000000..fb29a3c8 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_BatchTranslateText_async] +from google.cloud import translate_v3beta1 + + +async def sample_batch_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_BatchTranslateText_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py new file mode 100644 index 00000000..abfb2f2f --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchTranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_BatchTranslateText_sync] +from google.cloud import translate_v3beta1 + + +def sample_batch_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + input_configs = translate_v3beta1.InputConfig() + input_configs.gcs_source.input_uri = "input_uri_value" + + output_config = translate_v3beta1.OutputConfig() + output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value" + + request = translate_v3beta1.BatchTranslateTextRequest( + parent="parent_value", + source_language_code="source_language_code_value", + target_language_codes=['target_language_codes_value_1', 'target_language_codes_value_2'], + input_configs=input_configs, + output_config=output_config, + ) + + # Make the request + operation = client.batch_translate_text(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_BatchTranslateText_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py new file mode 100644 index 00000000..89493d7b --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_CreateGlossary_async] +from google.cloud import translate_v3beta1 + + +async def sample_create_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + glossary = translate_v3beta1.Glossary() + glossary.name = "name_value" + + request = translate_v3beta1.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_CreateGlossary_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py new file mode 100644 index 00000000..5d77d679 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_CreateGlossary_sync] +from google.cloud import translate_v3beta1 + + +def sample_create_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + glossary = translate_v3beta1.Glossary() + glossary.name = "name_value" + + request = translate_v3beta1.CreateGlossaryRequest( + parent="parent_value", + glossary=glossary, + ) + + # Make the request + operation = client.create_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_CreateGlossary_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py new file mode 100644 index 00000000..29b4b058 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_DeleteGlossary_async] +from google.cloud import translate_v3beta1 + + +async def sample_delete_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_DeleteGlossary_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py new file mode 100644 index 00000000..5be48498 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_DeleteGlossary_sync] +from google.cloud import translate_v3beta1 + + +def sample_delete_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DeleteGlossaryRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_glossary(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_DeleteGlossary_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py new file mode 100644 index 00000000..186db7fd --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_DetectLanguage_async] +from google.cloud import translate_v3beta1 + + +async def sample_detect_language(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = await client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_DetectLanguage_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py new file mode 100644 index 00000000..20e973fc --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectLanguage +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_DetectLanguage_sync] +from google.cloud import translate_v3beta1 + + +def sample_detect_language(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.DetectLanguageRequest( + content="content_value", + parent="parent_value", + ) + + # Make the request + response = client.detect_language(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_DetectLanguage_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py new file mode 100644 index 00000000..8622506f --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_GetGlossary_async] +from google.cloud import translate_v3beta1 + + +async def sample_get_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_GetGlossary_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py new file mode 100644 index 00000000..44146f48 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGlossary +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_GetGlossary_sync] +from google.cloud import translate_v3beta1 + + +def sample_get_glossary(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetGlossaryRequest( + name="name_value", + ) + + # Make the request + response = client.get_glossary(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_GetGlossary_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py new file mode 100644 index 00000000..db1d922d --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async] +from google.cloud import translate_v3beta1 + + +async def sample_get_supported_languages(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py new file mode 100644 index 00000000..788bab5e --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSupportedLanguages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_GetSupportedLanguages_sync] +from google.cloud import translate_v3beta1 + + +def sample_get_supported_languages(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.GetSupportedLanguagesRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_supported_languages(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_GetSupportedLanguages_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py new file mode 100644 index 00000000..db19a567 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_ListGlossaries_async] +from google.cloud import translate_v3beta1 + + +async def sample_list_glossaries(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END translate_v3beta1_generated_TranslationService_ListGlossaries_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py new file mode 100644 index 00000000..7d552502 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGlossaries +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_ListGlossaries_sync] +from google.cloud import translate_v3beta1 + + +def sample_list_glossaries(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.ListGlossariesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_glossaries(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END translate_v3beta1_generated_TranslationService_ListGlossaries_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py new file mode 100644 index 00000000..4c96d229 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_TranslateDocument_async] +from google.cloud import translate_v3beta1 + + +async def sample_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + document_input_config = translate_v3beta1.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3beta1.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = await client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_TranslateDocument_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py new file mode 100644 index 00000000..2c1ff501 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_TranslateDocument_sync] +from google.cloud import translate_v3beta1 + + +def sample_translate_document(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + document_input_config = translate_v3beta1.DocumentInputConfig() + document_input_config.content = b'content_blob' + + request = translate_v3beta1.TranslateDocumentRequest( + parent="parent_value", + target_language_code="target_language_code_value", + document_input_config=document_input_config, + ) + + # Make the request + response = client.translate_document(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_TranslateDocument_sync] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py new file mode 100644 index 00000000..83b22d70 --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_TranslateText_async] +from google.cloud import translate_v3beta1 + + +async def sample_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceAsyncClient() + + # Initialize request argument(s) + request = translate_v3beta1.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = await client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_TranslateText_async] diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py new file mode 100644 index 00000000..2d082aab --- /dev/null +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TranslateText +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-translate + + +# [START translate_v3beta1_generated_TranslationService_TranslateText_sync] +from google.cloud import translate_v3beta1 + + +def sample_translate_text(): + # Create a client + client = translate_v3beta1.TranslationServiceClient() + + # Initialize request argument(s) + request = translate_v3beta1.TranslateTextRequest( + contents=['contents_value_1', 'contents_value_2'], + target_language_code="target_language_code_value", + parent="parent_value", + ) + + # Make the request + response = client.translate_text(request=request) + + # Handle the response + print(response) + +# [END translate_v3beta1_generated_TranslationService_TranslateText_sync] From b1793a2938ce8691ad6f9c8aa01e62e456984097 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 06:30:20 -0500 Subject: [PATCH 2/5] chore: update copyright year to 2022 (#339) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update copyright year to 2022 PiperOrigin-RevId: 431037888 Source-Link: https://github.com/googleapis/googleapis/commit/b3397f5febbf21dfc69b875ddabaf76bee765058 Source-Link: https://github.com/googleapis/googleapis-gen/commit/510b54e1cdefd53173984df16645081308fe897e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTEwYjU0ZTFjZGVmZDUzMTczOTg0ZGYxNjY0NTA4MTMwOGZlODk3ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- google/cloud/translate/__init__.py | 2 +- google/cloud/translate_v3/__init__.py | 2 +- google/cloud/translate_v3/services/__init__.py | 2 +- .../cloud/translate_v3/services/translation_service/__init__.py | 2 +- .../translate_v3/services/translation_service/async_client.py | 2 +- .../cloud/translate_v3/services/translation_service/client.py | 2 +- .../cloud/translate_v3/services/translation_service/pagers.py | 2 +- .../services/translation_service/transports/__init__.py | 2 +- .../services/translation_service/transports/base.py | 2 +- .../services/translation_service/transports/grpc.py | 2 +- .../services/translation_service/transports/grpc_asyncio.py | 2 +- google/cloud/translate_v3/types/__init__.py | 2 +- google/cloud/translate_v3/types/translation_service.py | 2 +- google/cloud/translate_v3beta1/__init__.py | 2 +- google/cloud/translate_v3beta1/services/__init__.py | 2 +- .../translate_v3beta1/services/translation_service/__init__.py | 2 +- .../services/translation_service/async_client.py | 2 +- .../translate_v3beta1/services/translation_service/client.py | 2 +- .../translate_v3beta1/services/translation_service/pagers.py | 2 +- .../services/translation_service/transports/__init__.py | 2 +- .../services/translation_service/transports/base.py | 2 +- .../services/translation_service/transports/grpc.py | 2 +- .../services/translation_service/transports/grpc_asyncio.py | 2 +- google/cloud/translate_v3beta1/types/__init__.py | 2 +- google/cloud/translate_v3beta1/types/translation_service.py | 2 +- ...erated_translation_service_batch_translate_document_async.py | 2 +- ...nerated_translation_service_batch_translate_document_sync.py | 2 +- ..._generated_translation_service_batch_translate_text_async.py | 2 +- ...3_generated_translation_service_batch_translate_text_sync.py | 2 +- ...te_v3_generated_translation_service_create_glossary_async.py | 2 +- ...ate_v3_generated_translation_service_create_glossary_sync.py | 2 +- ...te_v3_generated_translation_service_delete_glossary_async.py | 2 +- ...ate_v3_generated_translation_service_delete_glossary_sync.py | 2 +- ...te_v3_generated_translation_service_detect_language_async.py | 2 +- ...ate_v3_generated_translation_service_detect_language_sync.py | 2 +- ...slate_v3_generated_translation_service_get_glossary_async.py | 2 +- ...nslate_v3_generated_translation_service_get_glossary_sync.py | 2 +- ...nerated_translation_service_get_supported_languages_async.py | 2 +- ...enerated_translation_service_get_supported_languages_sync.py | 2 +- ...te_v3_generated_translation_service_list_glossaries_async.py | 2 +- ...ate_v3_generated_translation_service_list_glossaries_sync.py | 2 +- ...v3_generated_translation_service_translate_document_async.py | 2 +- ..._v3_generated_translation_service_translate_document_sync.py | 2 +- ...ate_v3_generated_translation_service_translate_text_async.py | 2 +- ...late_v3_generated_translation_service_translate_text_sync.py | 2 +- ...erated_translation_service_batch_translate_document_async.py | 2 +- ...nerated_translation_service_batch_translate_document_sync.py | 2 +- ..._generated_translation_service_batch_translate_text_async.py | 2 +- ...1_generated_translation_service_batch_translate_text_sync.py | 2 +- ...beta1_generated_translation_service_create_glossary_async.py | 2 +- ...3beta1_generated_translation_service_create_glossary_sync.py | 2 +- ...beta1_generated_translation_service_delete_glossary_async.py | 2 +- ...3beta1_generated_translation_service_delete_glossary_sync.py | 2 +- ...beta1_generated_translation_service_detect_language_async.py | 2 +- ...3beta1_generated_translation_service_detect_language_sync.py | 2 +- ..._v3beta1_generated_translation_service_get_glossary_async.py | 2 +- ...e_v3beta1_generated_translation_service_get_glossary_sync.py | 2 +- ...nerated_translation_service_get_supported_languages_async.py | 2 +- ...enerated_translation_service_get_supported_languages_sync.py | 2 +- ...beta1_generated_translation_service_list_glossaries_async.py | 2 +- ...3beta1_generated_translation_service_list_glossaries_sync.py | 2 +- ...a1_generated_translation_service_translate_document_async.py | 2 +- ...ta1_generated_translation_service_translate_document_sync.py | 2 +- ...3beta1_generated_translation_service_translate_text_async.py | 2 +- ...v3beta1_generated_translation_service_translate_text_sync.py | 2 +- scripts/fixup_translate_v3_keywords.py | 2 +- scripts/fixup_translate_v3beta1_keywords.py | 2 +- tests/__init__.py | 2 +- tests/unit/__init__.py | 2 +- tests/unit/gapic/__init__.py | 2 +- tests/unit/gapic/translate_v3/__init__.py | 2 +- tests/unit/gapic/translate_v3/test_translation_service.py | 2 +- tests/unit/gapic/translate_v3beta1/__init__.py | 2 +- tests/unit/gapic/translate_v3beta1/test_translation_service.py | 2 +- 74 files changed, 74 insertions(+), 74 deletions(-) diff --git a/google/cloud/translate/__init__.py b/google/cloud/translate/__init__.py index 4e2bdb63..3d7f3154 100644 --- a/google/cloud/translate/__init__.py +++ b/google/cloud/translate/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/__init__.py b/google/cloud/translate_v3/__init__.py index 0bd85463..e542fe05 100644 --- a/google/cloud/translate_v3/__init__.py +++ b/google/cloud/translate_v3/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/__init__.py b/google/cloud/translate_v3/services/__init__.py index 4de65971..e8e1c384 100644 --- a/google/cloud/translate_v3/services/__init__.py +++ b/google/cloud/translate_v3/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/__init__.py b/google/cloud/translate_v3/services/translation_service/__init__.py index 6d42bf0e..7fa9efeb 100644 --- a/google/cloud/translate_v3/services/translation_service/__init__.py +++ b/google/cloud/translate_v3/services/translation_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/async_client.py b/google/cloud/translate_v3/services/translation_service/async_client.py index c3651e91..ef7e26e5 100644 --- a/google/cloud/translate_v3/services/translation_service/async_client.py +++ b/google/cloud/translate_v3/services/translation_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/client.py b/google/cloud/translate_v3/services/translation_service/client.py index ec0eff50..76aeee39 100644 --- a/google/cloud/translate_v3/services/translation_service/client.py +++ b/google/cloud/translate_v3/services/translation_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/pagers.py b/google/cloud/translate_v3/services/translation_service/pagers.py index 08e0dfe7..acfb02c7 100644 --- a/google/cloud/translate_v3/services/translation_service/pagers.py +++ b/google/cloud/translate_v3/services/translation_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/transports/__init__.py b/google/cloud/translate_v3/services/translation_service/transports/__init__.py index 11cb0a7d..32fa3072 100644 --- a/google/cloud/translate_v3/services/translation_service/transports/__init__.py +++ b/google/cloud/translate_v3/services/translation_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/transports/base.py b/google/cloud/translate_v3/services/translation_service/transports/base.py index 2ab577dc..fe187985 100644 --- a/google/cloud/translate_v3/services/translation_service/transports/base.py +++ b/google/cloud/translate_v3/services/translation_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/transports/grpc.py b/google/cloud/translate_v3/services/translation_service/transports/grpc.py index 9beb6d58..2e278381 100644 --- a/google/cloud/translate_v3/services/translation_service/transports/grpc.py +++ b/google/cloud/translate_v3/services/translation_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py b/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py index c875f91f..ad354cf6 100644 --- a/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py +++ b/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/types/__init__.py b/google/cloud/translate_v3/types/__init__.py index 38820580..ca265522 100644 --- a/google/cloud/translate_v3/types/__init__.py +++ b/google/cloud/translate_v3/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3/types/translation_service.py b/google/cloud/translate_v3/types/translation_service.py index 8e52d14a..fc4fcf5a 100644 --- a/google/cloud/translate_v3/types/translation_service.py +++ b/google/cloud/translate_v3/types/translation_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/__init__.py b/google/cloud/translate_v3beta1/__init__.py index 0bd85463..e542fe05 100644 --- a/google/cloud/translate_v3beta1/__init__.py +++ b/google/cloud/translate_v3beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/__init__.py b/google/cloud/translate_v3beta1/services/__init__.py index 4de65971..e8e1c384 100644 --- a/google/cloud/translate_v3beta1/services/__init__.py +++ b/google/cloud/translate_v3beta1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/__init__.py b/google/cloud/translate_v3beta1/services/translation_service/__init__.py index 6d42bf0e..7fa9efeb 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/__init__.py +++ b/google/cloud/translate_v3beta1/services/translation_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/async_client.py b/google/cloud/translate_v3beta1/services/translation_service/async_client.py index 49c9cb95..328bd486 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/async_client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/client.py b/google/cloud/translate_v3beta1/services/translation_service/client.py index 32d4024c..7c3124c4 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/pagers.py b/google/cloud/translate_v3beta1/services/translation_service/pagers.py index 812c4152..e32a937a 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/pagers.py +++ b/google/cloud/translate_v3beta1/services/translation_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/transports/__init__.py b/google/cloud/translate_v3beta1/services/translation_service/transports/__init__.py index 11cb0a7d..32fa3072 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/transports/__init__.py +++ b/google/cloud/translate_v3beta1/services/translation_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/transports/base.py b/google/cloud/translate_v3beta1/services/translation_service/transports/base.py index 214105b0..2b22a574 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/transports/base.py +++ b/google/cloud/translate_v3beta1/services/translation_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py index d11df630..f138fb82 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py +++ b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py index 3aec3e8b..cbec7772 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py +++ b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/types/__init__.py b/google/cloud/translate_v3beta1/types/__init__.py index 38820580..ca265522 100644 --- a/google/cloud/translate_v3beta1/types/__init__.py +++ b/google/cloud/translate_v3beta1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/translate_v3beta1/types/translation_service.py b/google/cloud/translate_v3beta1/types/translation_service.py index ac51e013..ad78b95e 100644 --- a/google/cloud/translate_v3beta1/types/translation_service.py +++ b/google/cloud/translate_v3beta1/types/translation_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py index 61d5255a..9c2370f1 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py index fe994910..71148ff6 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_document_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py index 79b23f33..031a248d 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py index 99a45b93..b761dcc1 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_batch_translate_text_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py index bb195816..aa0f4757 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py index e99fca04..1112c5dc 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_create_glossary_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py index 99b02b8e..abc94843 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py index 8691e1b0..7d6a8c6f 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_delete_glossary_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py index 3eff2228..cd36e299 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py index fd1b85e2..f1181fdb 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_detect_language_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py index 2274c719..9f2181ab 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py index e11c7ed7..95279e14 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_glossary_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py index 2bf9d688..8b00aba3 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py index d23a8aca..e9c5d2ae 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_get_supported_languages_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py index d3616f0f..828220d5 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py index 4e3dfa7b..3e312463 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_list_glossaries_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py index 9c1902a8..5b14a9f0 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py index f5a301d3..850c6bd2 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_document_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py index afe0e253..4f5332d1 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py index 45fc51c5..7d3b71e7 100644 --- a/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py +++ b/samples/generated_samples/translate_v3_generated_translation_service_translate_text_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py index b062bac5..f7c9db2c 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py index 0bc01520..13002abb 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_document_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py index fb29a3c8..b8420e65 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py index abfb2f2f..c9a05c3f 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_batch_translate_text_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py index 89493d7b..bd7ccfbc 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py index 5d77d679..0482c4a3 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_create_glossary_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py index 29b4b058..37e6cbd4 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py index 5be48498..85c5d1a7 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_delete_glossary_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py index 186db7fd..60b84ae7 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py index 20e973fc..41b613ab 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_detect_language_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py index 8622506f..ca21ec9b 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py index 44146f48..05b6150a 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_glossary_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py index db1d922d..ad778d7e 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py index 788bab5e..e876c505 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_get_supported_languages_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py index db19a567..3861889f 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py index 7d552502..45a9bbf3 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_list_glossaries_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py index 4c96d229..48d36f87 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py index 2c1ff501..17e11f0a 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_document_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py index 83b22d70..13b945fc 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py index 2d082aab..ce4a042a 100644 --- a/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py +++ b/samples/generated_samples/translate_v3beta1_generated_translation_service_translate_text_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/fixup_translate_v3_keywords.py b/scripts/fixup_translate_v3_keywords.py index f05cb305..8045640a 100644 --- a/scripts/fixup_translate_v3_keywords.py +++ b/scripts/fixup_translate_v3_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/fixup_translate_v3beta1_keywords.py b/scripts/fixup_translate_v3beta1_keywords.py index f05cb305..8045640a 100644 --- a/scripts/fixup_translate_v3beta1_keywords.py +++ b/scripts/fixup_translate_v3beta1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/__init__.py b/tests/__init__.py index 4de65971..e8e1c384 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 4de65971..e8e1c384 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/__init__.py b/tests/unit/gapic/__init__.py index 4de65971..e8e1c384 100644 --- a/tests/unit/gapic/__init__.py +++ b/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/translate_v3/__init__.py b/tests/unit/gapic/translate_v3/__init__.py index 4de65971..e8e1c384 100644 --- a/tests/unit/gapic/translate_v3/__init__.py +++ b/tests/unit/gapic/translate_v3/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/translate_v3/test_translation_service.py b/tests/unit/gapic/translate_v3/test_translation_service.py index b82ff411..ddd53ba5 100644 --- a/tests/unit/gapic/translate_v3/test_translation_service.py +++ b/tests/unit/gapic/translate_v3/test_translation_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/translate_v3beta1/__init__.py b/tests/unit/gapic/translate_v3beta1/__init__.py index 4de65971..e8e1c384 100644 --- a/tests/unit/gapic/translate_v3beta1/__init__.py +++ b/tests/unit/gapic/translate_v3beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/translate_v3beta1/test_translation_service.py b/tests/unit/gapic/translate_v3beta1/test_translation_service.py index ec260dcd..b81843ad 100644 --- a/tests/unit/gapic/translate_v3beta1/test_translation_service.py +++ b/tests/unit/gapic/translate_v3beta1/test_translation_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 47fd69e264399000ddcd4f18a4018d4ff90a0677 Mon Sep 17 00:00:00 2001 From: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Date: Sat, 26 Feb 2022 12:45:41 -0600 Subject: [PATCH 3/5] chore: Update api_shortname in .repo-metadata.json (#332) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update api_shortname in .repo-metadata.json * chore: Update api_shortname in .repo-metadata.json * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix replacement in owlbot.py * fix indent * restore coverage at 100% Co-authored-by: Anthonios Partheniou Co-authored-by: Owl Bot --- .repo-metadata.json | 2 +- noxfile.py | 2 +- owlbot.py | 16 ++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index 58ab0eba..acc1eb81 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,5 +1,5 @@ { - "name": "translation", + "name": "translate", "name_pretty": "Cloud Translation", "product_documentation": "https://cloud.google.com/translate/docs/", "client_documentation": "https://cloud.google.com/python/docs/reference/translation/latest", diff --git a/noxfile.py b/noxfile.py index de41c6bf..2a2001c4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -175,7 +175,7 @@ def cover(session): test runs (not system test runs), and then erases coverage data. """ session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=99") + session.run("coverage", "report", "--show-missing", "--fail-under=100") session.run("coverage", "erase") diff --git a/owlbot.py b/owlbot.py index 5114aaf7..d3ef7ea0 100644 --- a/owlbot.py +++ b/owlbot.py @@ -41,26 +41,22 @@ "translation.py", ] + s.replace(library / ".coveragerc", + """google/cloud/translate/__init__.py""", + """google/__init__.py + google/cloud/__init__.py + google/cloud/translate/__init__.py""", + ) s.move(library, excludes=excludes) s.remove_staging_dirs() -s.replace(".coveragerc", - """omit = - google/cloud/translate/__init__.py""", - """omit = - google/__init__.py - google/cloud/__init__.py - google/cloud/translate/__init__.py""", -) - # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- templated_files = common.py_library( samples=True, microgenerator=True, - cov_level=99, ) s.move(templated_files, excludes=[".coveragerc"]) # microgenerator has a good .coveragerc file From 9fb48e6331b37494e9e95502db5128ff785f5e7a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 26 Feb 2022 20:14:46 +0100 Subject: [PATCH 4/5] chore(deps): update all dependencies (#335) Co-authored-by: Anthonios Partheniou --- samples/snippets/hybrid_glossaries/requirements-test.txt | 2 +- samples/snippets/hybrid_glossaries/requirements.txt | 2 +- samples/snippets/requirements-test.txt | 2 +- samples/snippets/requirements.txt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/snippets/hybrid_glossaries/requirements-test.txt b/samples/snippets/hybrid_glossaries/requirements-test.txt index 92709451..c2845bff 100644 --- a/samples/snippets/hybrid_glossaries/requirements-test.txt +++ b/samples/snippets/hybrid_glossaries/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.5 +pytest==7.0.1 diff --git a/samples/snippets/hybrid_glossaries/requirements.txt b/samples/snippets/hybrid_glossaries/requirements.txt index c6718477..a03674b3 100644 --- a/samples/snippets/hybrid_glossaries/requirements.txt +++ b/samples/snippets/hybrid_glossaries/requirements.txt @@ -1,3 +1,3 @@ -google-cloud-translate==3.6.1 +google-cloud-translate==3.7.0 google-cloud-vision==2.6.3 google-cloud-texttospeech==2.10.0 diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 23bba2f0..c4bb1f1c 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,3 +1,3 @@ backoff==1.11.1 flaky==3.7.0 -pytest==6.2.5 +pytest==7.0.1 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 8c51bb99..4e66f260 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,3 +1,3 @@ -google-cloud-translate==3.6.1 +google-cloud-translate==3.7.0 google-cloud-storage==2.1.0 -google-cloud-automl==2.6.0 +google-cloud-automl==2.7.0 From 7a2bdf05c387c89877d524ee5048f74e24141549 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 18:16:33 -0500 Subject: [PATCH 5/5] chore(main): release 3.7.1 (#338) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 887411b2..eee0695d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-translate/#history +### [3.7.1](https://github.com/googleapis/python-translate/compare/v3.7.0...v3.7.1) (2022-02-26) + + +### Documentation + +* add generated snippets ([#336](https://github.com/googleapis/python-translate/issues/336)) ([36c4483](https://github.com/googleapis/python-translate/commit/36c4483e9fac4933fc024fcae24ae8fbbdb470a0)) + ## [3.7.0](https://github.com/googleapis/python-translate/compare/v3.6.1...v3.7.0) (2022-02-03) diff --git a/setup.py b/setup.py index 3c1e1432..88767b3e 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-translate" description = "Google Cloud Translation API client library" -version = "3.7.0" +version = "3.7.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta'