From 0b364be25633e3854e7653dda8b18dab330ad218 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 14:29:29 -0500 Subject: [PATCH 1/2] docs: Add documentation for enums (#257) 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/recommender/client.py | 2 +- google/cloud/recommender_v1/types/insight.py | 54 ++++++++++++- .../recommender_v1/types/recommendation.py | 75 +++++++++++++++++- .../services/recommender/client.py | 2 +- .../recommender_v1beta1/types/insight.py | 54 ++++++++++++- .../types/recommendation.py | 78 ++++++++++++++++++- recommender-v1beta1-py.tar.gz | 0 ..._metadata_google.cloud.recommender.v1.json | 2 +- ...data_google.cloud.recommender.v1beta1.json | 2 +- 9 files changed, 253 insertions(+), 16 deletions(-) create mode 100644 recommender-v1beta1-py.tar.gz diff --git a/google/cloud/recommender_v1/services/recommender/client.py b/google/cloud/recommender_v1/services/recommender/client.py index 4fdc05a..1dade1c 100644 --- a/google/cloud/recommender_v1/services/recommender/client.py +++ b/google/cloud/recommender_v1/services/recommender/client.py @@ -2079,7 +2079,7 @@ def sample_update_insight_type_config(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "RecommenderClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/recommender_v1/types/insight.py b/google/cloud/recommender_v1/types/insight.py index 4a9a2dd..30349fa 100644 --- a/google/cloud/recommender_v1/types/insight.py +++ b/google/cloud/recommender_v1/types/insight.py @@ -70,7 +70,20 @@ class Insight(proto.Message): """ class Category(proto.Enum): - r"""Insight category.""" + r"""Insight category. + + Values: + CATEGORY_UNSPECIFIED (0): + Unspecified category. + COST (1): + The insight is related to cost. + SECURITY (2): + The insight is related to security. + PERFORMANCE (3): + The insight is related to performance. + MANAGEABILITY (4): + This insight is related to manageability. + """ CATEGORY_UNSPECIFIED = 0 COST = 1 SECURITY = 2 @@ -78,7 +91,20 @@ class Category(proto.Enum): MANAGEABILITY = 4 class Severity(proto.Enum): - r"""Insight severity levels.""" + r"""Insight severity levels. + + Values: + SEVERITY_UNSPECIFIED (0): + Insight has unspecified severity. + LOW (1): + Insight has low severity. + MEDIUM (2): + Insight has medium severity. + HIGH (3): + Insight has high severity. + CRITICAL (4): + Insight has critical severity. + """ SEVERITY_UNSPECIFIED = 0 LOW = 1 MEDIUM = 2 @@ -170,7 +196,29 @@ class InsightStateInfo(proto.Message): """ class State(proto.Enum): - r"""Represents insight state.""" + r"""Represents insight state. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + ACTIVE (1): + Insight is active. Content for ACTIVE + insights can be updated by Google. ACTIVE + insights can be marked DISMISSED OR ACCEPTED. + ACCEPTED (2): + Some action has been taken based on this + insight. Insights become accepted when a + recommendation derived from the insight has been + marked CLAIMED, SUCCEEDED, or FAILED. ACTIVE + insights can also be marked ACCEPTED explicitly. + Content for ACCEPTED insights is immutable. + ACCEPTED insights can only be marked ACCEPTED + (which may update state metadata). + DISMISSED (3): + Insight is dismissed. Content for DISMISSED + insights can be updated by Google. DISMISSED + insights can be marked as ACTIVE. + """ STATE_UNSPECIFIED = 0 ACTIVE = 1 ACCEPTED = 2 diff --git a/google/cloud/recommender_v1/types/recommendation.py b/google/cloud/recommender_v1/types/recommendation.py index e16466d..f92c97c 100644 --- a/google/cloud/recommender_v1/types/recommendation.py +++ b/google/cloud/recommender_v1/types/recommendation.py @@ -96,7 +96,24 @@ class Recommendation(proto.Message): """ class Priority(proto.Enum): - r"""Recommendation priority levels.""" + r"""Recommendation priority levels. + + Values: + PRIORITY_UNSPECIFIED (0): + Recommendation has unspecified priority. + P4 (1): + Recommendation has P4 priority (lowest + priority). + P3 (2): + Recommendation has P3 priority (second lowest + priority). + P2 (3): + Recommendation has P2 priority (second + highest priority). + P1 (4): + Recommendation has P1 priority (highest + priority). + """ PRIORITY_UNSPECIFIED = 0 P4 = 1 P3 = 2 @@ -472,7 +489,25 @@ class Impact(proto.Message): """ class Category(proto.Enum): - r"""The category of the impact.""" + r"""The category of the impact. + + Values: + CATEGORY_UNSPECIFIED (0): + Default unspecified category. Don't use + directly. + COST (1): + Indicates a potential increase or decrease in + cost. + SECURITY (2): + Indicates a potential increase or decrease in + security. + PERFORMANCE (3): + Indicates a potential increase or decrease in + performance. + MANAGEABILITY (4): + Indicates a potential increase or decrease in + manageability. + """ CATEGORY_UNSPECIFIED = 0 COST = 1 SECURITY = 2 @@ -511,7 +546,41 @@ class RecommendationStateInfo(proto.Message): """ class State(proto.Enum): - r"""Represents Recommendation State.""" + r"""Represents Recommendation State. + + Values: + STATE_UNSPECIFIED (0): + Default state. Don't use directly. + ACTIVE (1): + Recommendation is active and can be applied. + Recommendations content can be updated by + Google. + ACTIVE recommendations can be marked as CLAIMED, + SUCCEEDED, or FAILED. + CLAIMED (6): + Recommendation is in claimed state. + Recommendations content is immutable and cannot + be updated by Google. + CLAIMED recommendations can be marked as + CLAIMED, SUCCEEDED, or FAILED. + SUCCEEDED (3): + Recommendation is in succeeded state. + Recommendations content is immutable and cannot + be updated by Google. + SUCCEEDED recommendations can be marked as + SUCCEEDED, or FAILED. + FAILED (4): + Recommendation is in failed state. + Recommendations content is immutable and cannot + be updated by Google. + FAILED recommendations can be marked as + SUCCEEDED, or FAILED. + DISMISSED (5): + Recommendation is in dismissed state. + Recommendation content can be updated by Google. + DISMISSED recommendations can be marked as + ACTIVE. + """ STATE_UNSPECIFIED = 0 ACTIVE = 1 CLAIMED = 6 diff --git a/google/cloud/recommender_v1beta1/services/recommender/client.py b/google/cloud/recommender_v1beta1/services/recommender/client.py index d9c1c33..9574cb3 100644 --- a/google/cloud/recommender_v1beta1/services/recommender/client.py +++ b/google/cloud/recommender_v1beta1/services/recommender/client.py @@ -2079,7 +2079,7 @@ def sample_update_insight_type_config(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "RecommenderClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/recommender_v1beta1/types/insight.py b/google/cloud/recommender_v1beta1/types/insight.py index 54f21ec..a40a717 100644 --- a/google/cloud/recommender_v1beta1/types/insight.py +++ b/google/cloud/recommender_v1beta1/types/insight.py @@ -70,7 +70,20 @@ class Insight(proto.Message): """ class Category(proto.Enum): - r"""Insight category.""" + r"""Insight category. + + Values: + CATEGORY_UNSPECIFIED (0): + Unspecified category. + COST (1): + The insight is related to cost. + SECURITY (2): + The insight is related to security. + PERFORMANCE (3): + The insight is related to performance. + MANAGEABILITY (4): + This insight is related to manageability. + """ CATEGORY_UNSPECIFIED = 0 COST = 1 SECURITY = 2 @@ -78,7 +91,20 @@ class Category(proto.Enum): MANAGEABILITY = 4 class Severity(proto.Enum): - r"""Insight severity levels.""" + r"""Insight severity levels. + + Values: + SEVERITY_UNSPECIFIED (0): + Insight has unspecified severity. + LOW (1): + Insight has low severity. + MEDIUM (2): + Insight has medium severity. + HIGH (3): + Insight has high severity. + CRITICAL (4): + Insight has critical severity. + """ SEVERITY_UNSPECIFIED = 0 LOW = 1 MEDIUM = 2 @@ -170,7 +196,29 @@ class InsightStateInfo(proto.Message): """ class State(proto.Enum): - r"""Represents insight state.""" + r"""Represents insight state. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + ACTIVE (1): + Insight is active. Content for ACTIVE + insights can be updated by Google. ACTIVE + insights can be marked DISMISSED OR ACCEPTED. + ACCEPTED (2): + Some action has been taken based on this + insight. Insights become accepted when a + recommendation derived from the insight has been + marked CLAIMED, SUCCEEDED, or FAILED. ACTIVE + insights can also be marked ACCEPTED explicitly. + Content for ACCEPTED insights is immutable. + ACCEPTED insights can only be marked ACCEPTED + (which may update state metadata). + DISMISSED (3): + Insight is dismissed. Content for DISMISSED + insights can be updated by Google. DISMISSED + insights can be marked as ACTIVE. + """ STATE_UNSPECIFIED = 0 ACTIVE = 1 ACCEPTED = 2 diff --git a/google/cloud/recommender_v1beta1/types/recommendation.py b/google/cloud/recommender_v1beta1/types/recommendation.py index db7dd77..291d096 100644 --- a/google/cloud/recommender_v1beta1/types/recommendation.py +++ b/google/cloud/recommender_v1beta1/types/recommendation.py @@ -97,7 +97,24 @@ class Recommendation(proto.Message): """ class Priority(proto.Enum): - r"""Recommendation priority levels.""" + r"""Recommendation priority levels. + + Values: + PRIORITY_UNSPECIFIED (0): + Recommendation has unspecified priority. + P4 (1): + Recommendation has P4 priority (lowest + priority). + P3 (2): + Recommendation has P3 priority (second lowest + priority). + P2 (3): + Recommendation has P2 priority (second + highest priority). + P1 (4): + Recommendation has P1 priority (highest + priority). + """ PRIORITY_UNSPECIFIED = 0 P4 = 1 P3 = 2 @@ -502,7 +519,28 @@ class Impact(proto.Message): """ class Category(proto.Enum): - r"""The category of the impact.""" + r"""The category of the impact. + + Values: + CATEGORY_UNSPECIFIED (0): + Default unspecified category. Don't use + directly. + COST (1): + Indicates a potential increase or decrease in + cost. + SECURITY (2): + Indicates a potential increase or decrease in + security. + PERFORMANCE (3): + Indicates a potential increase or decrease in + performance. + MANAGEABILITY (4): + Indicates a potential increase or decrease in + manageability. + SUSTAINABILITY (5): + Indicates a potential increase or decrease in + sustainability. + """ CATEGORY_UNSPECIFIED = 0 COST = 1 SECURITY = 2 @@ -548,7 +586,41 @@ class RecommendationStateInfo(proto.Message): """ class State(proto.Enum): - r"""Represents Recommendation State.""" + r"""Represents Recommendation State. + + Values: + STATE_UNSPECIFIED (0): + Default state. Don't use directly. + ACTIVE (1): + Recommendation is active and can be applied. + Recommendations content can be updated by + Google. + ACTIVE recommendations can be marked as CLAIMED, + SUCCEEDED, or FAILED. + CLAIMED (6): + Recommendation is in claimed state. + Recommendations content is immutable and cannot + be updated by Google. + CLAIMED recommendations can be marked as + CLAIMED, SUCCEEDED, or FAILED. + SUCCEEDED (3): + Recommendation is in succeeded state. + Recommendations content is immutable and cannot + be updated by Google. + SUCCEEDED recommendations can be marked as + SUCCEEDED, or FAILED. + FAILED (4): + Recommendation is in failed state. + Recommendations content is immutable and cannot + be updated by Google. + FAILED recommendations can be marked as + SUCCEEDED, or FAILED. + DISMISSED (5): + Recommendation is in dismissed state. + Recommendation content can be updated by Google. + DISMISSED recommendations can be marked as + ACTIVE. + """ STATE_UNSPECIFIED = 0 ACTIVE = 1 CLAIMED = 6 diff --git a/recommender-v1beta1-py.tar.gz b/recommender-v1beta1-py.tar.gz new file mode 100644 index 0000000..e69de29 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json index c7792c9..1755569 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-recommender", - "version": "2.10.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json index 99e5070..fd53d49 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-recommender", - "version": "2.10.0" + "version": "0.1.0" }, "snippets": [ { From f2b099ed498eb70e3b64ed624a9d041479a7d6ba Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:38:05 -0500 Subject: [PATCH 2/2] chore(main): release 2.10.1 (#258) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ google/cloud/recommender/gapic_version.py | 2 +- google/cloud/recommender_v1/gapic_version.py | 2 +- google/cloud/recommender_v1beta1/gapic_version.py | 2 +- ...snippet_metadata_google.cloud.recommender.v1.json | 2 +- ...et_metadata_google.cloud.recommender.v1beta1.json | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f393718..c3a98a6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.10.0" + ".": "2.10.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8856f36..e09493f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-recommender/#history +## [2.10.1](https://github.com/googleapis/python-recommender/compare/v2.10.0...v2.10.1) (2023-01-20) + + +### Bug Fixes + +* Add context manager return types ([0b364be](https://github.com/googleapis/python-recommender/commit/0b364be25633e3854e7653dda8b18dab330ad218)) + + +### Documentation + +* Add documentation for enums ([0b364be](https://github.com/googleapis/python-recommender/commit/0b364be25633e3854e7653dda8b18dab330ad218)) + ## [2.10.0](https://github.com/googleapis/python-recommender/compare/v2.9.0...v2.10.0) (2023-01-10) diff --git a/google/cloud/recommender/gapic_version.py b/google/cloud/recommender/gapic_version.py index 00f0a8d..3dded20 100644 --- a/google/cloud/recommender/gapic_version.py +++ b/google/cloud/recommender/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/google/cloud/recommender_v1/gapic_version.py b/google/cloud/recommender_v1/gapic_version.py index 00f0a8d..3dded20 100644 --- a/google/cloud/recommender_v1/gapic_version.py +++ b/google/cloud/recommender_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/google/cloud/recommender_v1beta1/gapic_version.py b/google/cloud/recommender_v1beta1/gapic_version.py index 00f0a8d..3dded20 100644 --- a/google/cloud/recommender_v1beta1/gapic_version.py +++ b/google/cloud/recommender_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json index 1755569..1d25eb8 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-recommender", - "version": "0.1.0" + "version": "2.10.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json index fd53d49..beb411a 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-recommender", - "version": "0.1.0" + "version": "2.10.1" }, "snippets": [ {