From 740f3b1c5d662781c319a746bed4bb613ef947f3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 15:30:41 -0500 Subject: [PATCH] docs: Add documentation for enums (#205) 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 * restore rest support Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../auto_suggestion_service/client.py | 2 +- .../services/question_service/client.py | 2 +- .../dataqna_v1alpha/types/annotated_string.py | 21 ++++- .../types/auto_suggestion_service.py | 13 ++- .../cloud/dataqna_v1alpha/types/question.py | 87 ++++++++++++++++++- .../dataqna_v1alpha/types/user_feedback.py | 11 ++- ...metadata_google.cloud.dataqna.v1alpha.json | 2 +- 7 files changed, 130 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/auto_suggestion_service/client.py b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/auto_suggestion_service/client.py index 561c2bff5db2..0142d3742e08 100644 --- a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/auto_suggestion_service/client.py +++ b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/auto_suggestion_service/client.py @@ -575,7 +575,7 @@ def sample_suggest_queries(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "AutoSuggestionServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/question_service/client.py b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/question_service/client.py index fd6f4ee4370c..d6f1865afa45 100644 --- a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/question_service/client.py +++ b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/services/question_service/client.py @@ -1052,7 +1052,7 @@ def sample_update_user_feedback(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "QuestionServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/annotated_string.py b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/annotated_string.py index 36ccfd2040f7..1e396063f8dc 100644 --- a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/annotated_string.py +++ b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/annotated_string.py @@ -67,7 +67,26 @@ class AnnotatedString(proto.Message): """ class SemanticMarkupType(proto.Enum): - r"""Semantic markup types.""" + r"""Semantic markup types. + + Values: + MARKUP_TYPE_UNSPECIFIED (0): + No markup type was specified. + METRIC (1): + Markup for a substring denoting a metric. + DIMENSION (2): + Markup for a substring denoting a dimension. + FILTER (3): + Markup for a substring denoting a filter. + UNUSED (4): + Markup for an unused substring. + BLOCKED (5): + Markup for a substring containing blocked + phrases. + ROW (6): + Markup for a substring that contains terms + for row. + """ MARKUP_TYPE_UNSPECIFIED = 0 METRIC = 1 DIMENSION = 2 diff --git a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/auto_suggestion_service.py b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/auto_suggestion_service.py index c09787efcb13..ca9f1fe2a35e 100644 --- a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/auto_suggestion_service.py +++ b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/auto_suggestion_service.py @@ -32,7 +32,18 @@ class SuggestionType(proto.Enum): - r"""The type of suggestion.""" + r"""The type of suggestion. + + Values: + SUGGESTION_TYPE_UNSPECIFIED (0): + No suggestiont type is specified. + ENTITY (1): + Entity suggestion type. Suggestions are for + single entities. + TEMPLATE (2): + Template suggestion type. Suggestions are for + full sentences. + """ SUGGESTION_TYPE_UNSPECIFIED = 0 ENTITY = 1 TEMPLATE = 2 diff --git a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/question.py b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/question.py index a82bc1ab4a45..7a2ffb8b5c28 100644 --- a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/question.py +++ b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/question.py @@ -40,7 +40,16 @@ class InterpretEntity(proto.Enum): - r"""Query entities of an interpretation.""" + r"""Query entities of an interpretation. + + Values: + INTERPRET_ENTITY_UNSPECIFIED (0): + No interpret entity was specified. + DIMENSION (1): + A dimenstion entity. + METRIC (2): + A metric entity. + """ INTERPRET_ENTITY_UNSPECIFIED = 0 DIMENSION = 1 METRIC = 2 @@ -167,6 +176,21 @@ class InterpretError(proto.Message): class InterpretErrorCode(proto.Enum): r"""The interpret error code provides an error category why the interpretation failed. + + Values: + INTERPRET_ERROR_CODE_UNSPECIFIED (0): + No interpret error code was specified. + INVALID_QUERY (1): + The query is not valid. + FAILED_TO_UNDERSTAND (2): + The interpreter failed to understand the + question. For example, because it was too + ambiguous. + FAILED_TO_ANSWER (3): + The interpreter could understand the + question, but was not able to arrive at an + answer. For example, because a requested + operation is not supported. """ INTERPRET_ERROR_CODE_UNSPECIFIED = 0 INVALID_QUERY = 1 @@ -280,7 +304,20 @@ class ExecutionInfo(proto.Message): """ class JobExecutionState(proto.Enum): - r"""Enum of possible job execution statuses.""" + r"""Enum of possible job execution statuses. + + Values: + JOB_EXECUTION_STATE_UNSPECIFIED (0): + No job execution was specified. + NOT_EXECUTED (1): + No job execution was requested, yet. + RUNNING (2): + The job is running. + SUCCEEDED (3): + The job completed successfully. + FAILED (4): + The job completed unsuccessfully. + """ JOB_EXECUTION_STATE_UNSPECIFIED = 0 NOT_EXECUTED = 1 RUNNING = 2 @@ -463,6 +500,52 @@ class InterpretationStructure(proto.Message): class VisualizationType(proto.Enum): r"""Enumeration of visualzation types to use for query response data. + + Values: + VISUALIZATION_TYPE_UNSPECIFIED (0): + No visualization type was specified. + TABLE (1): + Show a table. + BAR_CHART (2): + Show a `bar + chart `__. + COLUMN_CHART (3): + Show a `column + chart `__. + TIMELINE (4): + Show a + `timeline `__. + SCATTER_PLOT (5): + Show a `scatter + plot `__. + PIE_CHART (6): + Show a `pie + chart `__. + LINE_CHART (7): + Show a `line + chart `__. + AREA_CHART (8): + Show an `area + chart `__. + COMBO_CHART (9): + Show a `combo + chart `__. + HISTOGRAM (10): + Show a + `histogram `__. + GENERIC_CHART (11): + This denotes queries when the user has not + specified the particular type of chart and has + mentioned only a generic chart name such as + "Chart", "Plot", "Graph", etc. This will + differentiate it from specific charting terms + such as "Bar chart", "Pie chart", etc. + CHART_NOT_UNDERSTOOD (12): + The user tried to specify a chart type, but + the interpreter could not understand the type. + The client should display a generic chart and + may give a hint to the user that the requested + type was not understood. """ VISUALIZATION_TYPE_UNSPECIFIED = 0 TABLE = 1 diff --git a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/user_feedback.py b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/user_feedback.py index 52cdd646664a..8682acad44e7 100644 --- a/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/user_feedback.py +++ b/packages/google-cloud-data-qna/google/cloud/dataqna_v1alpha/types/user_feedback.py @@ -40,7 +40,16 @@ class UserFeedback(proto.Message): """ class UserFeedbackRating(proto.Enum): - r"""Enumeration of feedback ratings.""" + r"""Enumeration of feedback ratings. + + Values: + USER_FEEDBACK_RATING_UNSPECIFIED (0): + No rating was specified. + POSITIVE (1): + The user provided positive feedback. + NEGATIVE (2): + The user provided negative feedback. + """ USER_FEEDBACK_RATING_UNSPECIFIED = 0 POSITIVE = 1 NEGATIVE = 2 diff --git a/packages/google-cloud-data-qna/samples/generated_samples/snippet_metadata_google.cloud.dataqna.v1alpha.json b/packages/google-cloud-data-qna/samples/generated_samples/snippet_metadata_google.cloud.dataqna.v1alpha.json index 776fa39324b4..2325b770fe09 100644 --- a/packages/google-cloud-data-qna/samples/generated_samples/snippet_metadata_google.cloud.dataqna.v1alpha.json +++ b/packages/google-cloud-data-qna/samples/generated_samples/snippet_metadata_google.cloud.dataqna.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-data-qna", - "version": "0.10.0" + "version": "0.1.0" }, "snippets": [ {