From e20fa00103e51e321c0e44317df6765570a20fc8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:23:30 -0500 Subject: [PATCH] docs: Add documentation for enums (#476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 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 --- .../services/translation_service/client.py | 2 +- .../translate_v3/types/translation_service.py | 86 ++++++++++++++++++- .../services/translation_service/client.py | 2 +- .../types/translation_service.py | 86 ++++++++++++++++++- 4 files changed, 170 insertions(+), 6 deletions(-) diff --git a/google/cloud/translate_v3/services/translation_service/client.py b/google/cloud/translate_v3/services/translation_service/client.py index 961bb736..b2adf508 100644 --- a/google/cloud/translate_v3/services/translation_service/client.py +++ b/google/cloud/translate_v3/services/translation_service/client.py @@ -1835,7 +1835,7 @@ def sample_delete_glossary(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "TranslationServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/translate_v3/types/translation_service.py b/google/cloud/translate_v3/types/translation_service.py index a0b16a12..742a86bd 100644 --- a/google/cloud/translate_v3/types/translation_service.py +++ b/google/cloud/translate_v3/types/translation_service.py @@ -1143,7 +1143,30 @@ class BatchTranslateMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the job.""" + r"""State of the job. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The batch is processed, and at least one item + was successfully processed. + FAILED (3): + The batch is done and no item was + successfully processed. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The batch is done after the user has called + the longrunning.Operations.CancelOperation. Any + records processed before the cancel command are + output as specified in the request. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 SUCCEEDED = 2 @@ -1540,6 +1563,24 @@ class CreateGlossaryMetadata(proto.Message): class State(proto.Enum): r"""Enumerates the possible states that the creation request can be in. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The glossary was successfully created. + FAILED (3): + Failed to create the glossary. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The glossary creation request was + successfully canceled. """ STATE_UNSPECIFIED = 0 RUNNING = 1 @@ -1584,6 +1625,24 @@ class DeleteGlossaryMetadata(proto.Message): class State(proto.Enum): r"""Enumerates the possible states that the creation request can be in. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The glossary was successfully deleted. + FAILED (3): + Failed to delete the glossary. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The glossary deletion request was + successfully canceled. """ STATE_UNSPECIFIED = 0 RUNNING = 1 @@ -1989,7 +2048,30 @@ class BatchTranslateDocumentMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the job.""" + r"""State of the job. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The batch is processed, and at least one item + was successfully processed. + FAILED (3): + The batch is done and no item was + successfully processed. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The batch is done after the user has called + the longrunning.Operations.CancelOperation. Any + records processed before the cancel command are + output as specified in the request. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 SUCCEEDED = 2 diff --git a/google/cloud/translate_v3beta1/services/translation_service/client.py b/google/cloud/translate_v3beta1/services/translation_service/client.py index 7d2eda12..9125b32e 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/client.py @@ -1740,7 +1740,7 @@ def sample_delete_glossary(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "TranslationServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/translate_v3beta1/types/translation_service.py b/google/cloud/translate_v3beta1/types/translation_service.py index 22846ce1..ca2e36f1 100644 --- a/google/cloud/translate_v3beta1/types/translation_service.py +++ b/google/cloud/translate_v3beta1/types/translation_service.py @@ -1133,7 +1133,30 @@ class BatchTranslateMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the job.""" + r"""State of the job. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The batch is processed, and at least one item + was successfully processed. + FAILED (3): + The batch is done and no item was + successfully processed. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The batch is done after the user has called + the longrunning.Operations.CancelOperation. Any + records processed before the cancel command are + output as specified in the request. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 SUCCEEDED = 2 @@ -1531,6 +1554,24 @@ class CreateGlossaryMetadata(proto.Message): class State(proto.Enum): r"""Enumerates the possible states that the creation request can be in. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The glossary was successfully created. + FAILED (3): + Failed to create the glossary. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The glossary creation request was + successfully canceled. """ STATE_UNSPECIFIED = 0 RUNNING = 1 @@ -1575,6 +1616,24 @@ class DeleteGlossaryMetadata(proto.Message): class State(proto.Enum): r"""Enumerates the possible states that the creation request can be in. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The glossary was successfully deleted. + FAILED (3): + Failed to delete the glossary. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The glossary deletion request was + successfully canceled. """ STATE_UNSPECIFIED = 0 RUNNING = 1 @@ -1980,7 +2039,30 @@ class BatchTranslateDocumentMetadata(proto.Message): """ class State(proto.Enum): - r"""State of the job.""" + r"""State of the job. + + Values: + STATE_UNSPECIFIED (0): + Invalid. + RUNNING (1): + Request is being processed. + SUCCEEDED (2): + The batch is processed, and at least one item + was successfully processed. + FAILED (3): + The batch is done and no item was + successfully processed. + CANCELLING (4): + Request is in the process of being canceled + after caller invoked + longrunning.Operations.CancelOperation on the + request id. + CANCELLED (5): + The batch is done after the user has called + the longrunning.Operations.CancelOperation. Any + records processed before the cancel command are + output as specified in the request. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 SUCCEEDED = 2