Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 0b364be

Browse files
docs: Add documentation for enums (#257)
* 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: googleapis/googleapis@a391fd1 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f1e7ae8 commit 0b364be

File tree

9 files changed

+253
-16
lines changed

9 files changed

+253
-16
lines changed

google/cloud/recommender_v1/services/recommender/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,7 +2079,7 @@ def sample_update_insight_type_config():
20792079
# Done; return the response.
20802080
return response
20812081

2082-
def __enter__(self):
2082+
def __enter__(self) -> "RecommenderClient":
20832083
return self
20842084

20852085
def __exit__(self, type, value, traceback):

google/cloud/recommender_v1/types/insight.py

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,41 @@ class Insight(proto.Message):
7070
"""
7171

7272
class Category(proto.Enum):
73-
r"""Insight category."""
73+
r"""Insight category.
74+
75+
Values:
76+
CATEGORY_UNSPECIFIED (0):
77+
Unspecified category.
78+
COST (1):
79+
The insight is related to cost.
80+
SECURITY (2):
81+
The insight is related to security.
82+
PERFORMANCE (3):
83+
The insight is related to performance.
84+
MANAGEABILITY (4):
85+
This insight is related to manageability.
86+
"""
7487
CATEGORY_UNSPECIFIED = 0
7588
COST = 1
7689
SECURITY = 2
7790
PERFORMANCE = 3
7891
MANAGEABILITY = 4
7992

8093
class Severity(proto.Enum):
81-
r"""Insight severity levels."""
94+
r"""Insight severity levels.
95+
96+
Values:
97+
SEVERITY_UNSPECIFIED (0):
98+
Insight has unspecified severity.
99+
LOW (1):
100+
Insight has low severity.
101+
MEDIUM (2):
102+
Insight has medium severity.
103+
HIGH (3):
104+
Insight has high severity.
105+
CRITICAL (4):
106+
Insight has critical severity.
107+
"""
82108
SEVERITY_UNSPECIFIED = 0
83109
LOW = 1
84110
MEDIUM = 2
@@ -170,7 +196,29 @@ class InsightStateInfo(proto.Message):
170196
"""
171197

172198
class State(proto.Enum):
173-
r"""Represents insight state."""
199+
r"""Represents insight state.
200+
201+
Values:
202+
STATE_UNSPECIFIED (0):
203+
Unspecified state.
204+
ACTIVE (1):
205+
Insight is active. Content for ACTIVE
206+
insights can be updated by Google. ACTIVE
207+
insights can be marked DISMISSED OR ACCEPTED.
208+
ACCEPTED (2):
209+
Some action has been taken based on this
210+
insight. Insights become accepted when a
211+
recommendation derived from the insight has been
212+
marked CLAIMED, SUCCEEDED, or FAILED. ACTIVE
213+
insights can also be marked ACCEPTED explicitly.
214+
Content for ACCEPTED insights is immutable.
215+
ACCEPTED insights can only be marked ACCEPTED
216+
(which may update state metadata).
217+
DISMISSED (3):
218+
Insight is dismissed. Content for DISMISSED
219+
insights can be updated by Google. DISMISSED
220+
insights can be marked as ACTIVE.
221+
"""
174222
STATE_UNSPECIFIED = 0
175223
ACTIVE = 1
176224
ACCEPTED = 2

google/cloud/recommender_v1/types/recommendation.py

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,24 @@ class Recommendation(proto.Message):
9696
"""
9797

9898
class Priority(proto.Enum):
99-
r"""Recommendation priority levels."""
99+
r"""Recommendation priority levels.
100+
101+
Values:
102+
PRIORITY_UNSPECIFIED (0):
103+
Recommendation has unspecified priority.
104+
P4 (1):
105+
Recommendation has P4 priority (lowest
106+
priority).
107+
P3 (2):
108+
Recommendation has P3 priority (second lowest
109+
priority).
110+
P2 (3):
111+
Recommendation has P2 priority (second
112+
highest priority).
113+
P1 (4):
114+
Recommendation has P1 priority (highest
115+
priority).
116+
"""
100117
PRIORITY_UNSPECIFIED = 0
101118
P4 = 1
102119
P3 = 2
@@ -472,7 +489,25 @@ class Impact(proto.Message):
472489
"""
473490

474491
class Category(proto.Enum):
475-
r"""The category of the impact."""
492+
r"""The category of the impact.
493+
494+
Values:
495+
CATEGORY_UNSPECIFIED (0):
496+
Default unspecified category. Don't use
497+
directly.
498+
COST (1):
499+
Indicates a potential increase or decrease in
500+
cost.
501+
SECURITY (2):
502+
Indicates a potential increase or decrease in
503+
security.
504+
PERFORMANCE (3):
505+
Indicates a potential increase or decrease in
506+
performance.
507+
MANAGEABILITY (4):
508+
Indicates a potential increase or decrease in
509+
manageability.
510+
"""
476511
CATEGORY_UNSPECIFIED = 0
477512
COST = 1
478513
SECURITY = 2
@@ -511,7 +546,41 @@ class RecommendationStateInfo(proto.Message):
511546
"""
512547

513548
class State(proto.Enum):
514-
r"""Represents Recommendation State."""
549+
r"""Represents Recommendation State.
550+
551+
Values:
552+
STATE_UNSPECIFIED (0):
553+
Default state. Don't use directly.
554+
ACTIVE (1):
555+
Recommendation is active and can be applied.
556+
Recommendations content can be updated by
557+
Google.
558+
ACTIVE recommendations can be marked as CLAIMED,
559+
SUCCEEDED, or FAILED.
560+
CLAIMED (6):
561+
Recommendation is in claimed state.
562+
Recommendations content is immutable and cannot
563+
be updated by Google.
564+
CLAIMED recommendations can be marked as
565+
CLAIMED, SUCCEEDED, or FAILED.
566+
SUCCEEDED (3):
567+
Recommendation is in succeeded state.
568+
Recommendations content is immutable and cannot
569+
be updated by Google.
570+
SUCCEEDED recommendations can be marked as
571+
SUCCEEDED, or FAILED.
572+
FAILED (4):
573+
Recommendation is in failed state.
574+
Recommendations content is immutable and cannot
575+
be updated by Google.
576+
FAILED recommendations can be marked as
577+
SUCCEEDED, or FAILED.
578+
DISMISSED (5):
579+
Recommendation is in dismissed state.
580+
Recommendation content can be updated by Google.
581+
DISMISSED recommendations can be marked as
582+
ACTIVE.
583+
"""
515584
STATE_UNSPECIFIED = 0
516585
ACTIVE = 1
517586
CLAIMED = 6

google/cloud/recommender_v1beta1/services/recommender/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,7 +2079,7 @@ def sample_update_insight_type_config():
20792079
# Done; return the response.
20802080
return response
20812081

2082-
def __enter__(self):
2082+
def __enter__(self) -> "RecommenderClient":
20832083
return self
20842084

20852085
def __exit__(self, type, value, traceback):

google/cloud/recommender_v1beta1/types/insight.py

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,41 @@ class Insight(proto.Message):
7070
"""
7171

7272
class Category(proto.Enum):
73-
r"""Insight category."""
73+
r"""Insight category.
74+
75+
Values:
76+
CATEGORY_UNSPECIFIED (0):
77+
Unspecified category.
78+
COST (1):
79+
The insight is related to cost.
80+
SECURITY (2):
81+
The insight is related to security.
82+
PERFORMANCE (3):
83+
The insight is related to performance.
84+
MANAGEABILITY (4):
85+
This insight is related to manageability.
86+
"""
7487
CATEGORY_UNSPECIFIED = 0
7588
COST = 1
7689
SECURITY = 2
7790
PERFORMANCE = 3
7891
MANAGEABILITY = 4
7992

8093
class Severity(proto.Enum):
81-
r"""Insight severity levels."""
94+
r"""Insight severity levels.
95+
96+
Values:
97+
SEVERITY_UNSPECIFIED (0):
98+
Insight has unspecified severity.
99+
LOW (1):
100+
Insight has low severity.
101+
MEDIUM (2):
102+
Insight has medium severity.
103+
HIGH (3):
104+
Insight has high severity.
105+
CRITICAL (4):
106+
Insight has critical severity.
107+
"""
82108
SEVERITY_UNSPECIFIED = 0
83109
LOW = 1
84110
MEDIUM = 2
@@ -170,7 +196,29 @@ class InsightStateInfo(proto.Message):
170196
"""
171197

172198
class State(proto.Enum):
173-
r"""Represents insight state."""
199+
r"""Represents insight state.
200+
201+
Values:
202+
STATE_UNSPECIFIED (0):
203+
Unspecified state.
204+
ACTIVE (1):
205+
Insight is active. Content for ACTIVE
206+
insights can be updated by Google. ACTIVE
207+
insights can be marked DISMISSED OR ACCEPTED.
208+
ACCEPTED (2):
209+
Some action has been taken based on this
210+
insight. Insights become accepted when a
211+
recommendation derived from the insight has been
212+
marked CLAIMED, SUCCEEDED, or FAILED. ACTIVE
213+
insights can also be marked ACCEPTED explicitly.
214+
Content for ACCEPTED insights is immutable.
215+
ACCEPTED insights can only be marked ACCEPTED
216+
(which may update state metadata).
217+
DISMISSED (3):
218+
Insight is dismissed. Content for DISMISSED
219+
insights can be updated by Google. DISMISSED
220+
insights can be marked as ACTIVE.
221+
"""
174222
STATE_UNSPECIFIED = 0
175223
ACTIVE = 1
176224
ACCEPTED = 2

google/cloud/recommender_v1beta1/types/recommendation.py

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,24 @@ class Recommendation(proto.Message):
9797
"""
9898

9999
class Priority(proto.Enum):
100-
r"""Recommendation priority levels."""
100+
r"""Recommendation priority levels.
101+
102+
Values:
103+
PRIORITY_UNSPECIFIED (0):
104+
Recommendation has unspecified priority.
105+
P4 (1):
106+
Recommendation has P4 priority (lowest
107+
priority).
108+
P3 (2):
109+
Recommendation has P3 priority (second lowest
110+
priority).
111+
P2 (3):
112+
Recommendation has P2 priority (second
113+
highest priority).
114+
P1 (4):
115+
Recommendation has P1 priority (highest
116+
priority).
117+
"""
101118
PRIORITY_UNSPECIFIED = 0
102119
P4 = 1
103120
P3 = 2
@@ -502,7 +519,28 @@ class Impact(proto.Message):
502519
"""
503520

504521
class Category(proto.Enum):
505-
r"""The category of the impact."""
522+
r"""The category of the impact.
523+
524+
Values:
525+
CATEGORY_UNSPECIFIED (0):
526+
Default unspecified category. Don't use
527+
directly.
528+
COST (1):
529+
Indicates a potential increase or decrease in
530+
cost.
531+
SECURITY (2):
532+
Indicates a potential increase or decrease in
533+
security.
534+
PERFORMANCE (3):
535+
Indicates a potential increase or decrease in
536+
performance.
537+
MANAGEABILITY (4):
538+
Indicates a potential increase or decrease in
539+
manageability.
540+
SUSTAINABILITY (5):
541+
Indicates a potential increase or decrease in
542+
sustainability.
543+
"""
506544
CATEGORY_UNSPECIFIED = 0
507545
COST = 1
508546
SECURITY = 2
@@ -548,7 +586,41 @@ class RecommendationStateInfo(proto.Message):
548586
"""
549587

550588
class State(proto.Enum):
551-
r"""Represents Recommendation State."""
589+
r"""Represents Recommendation State.
590+
591+
Values:
592+
STATE_UNSPECIFIED (0):
593+
Default state. Don't use directly.
594+
ACTIVE (1):
595+
Recommendation is active and can be applied.
596+
Recommendations content can be updated by
597+
Google.
598+
ACTIVE recommendations can be marked as CLAIMED,
599+
SUCCEEDED, or FAILED.
600+
CLAIMED (6):
601+
Recommendation is in claimed state.
602+
Recommendations content is immutable and cannot
603+
be updated by Google.
604+
CLAIMED recommendations can be marked as
605+
CLAIMED, SUCCEEDED, or FAILED.
606+
SUCCEEDED (3):
607+
Recommendation is in succeeded state.
608+
Recommendations content is immutable and cannot
609+
be updated by Google.
610+
SUCCEEDED recommendations can be marked as
611+
SUCCEEDED, or FAILED.
612+
FAILED (4):
613+
Recommendation is in failed state.
614+
Recommendations content is immutable and cannot
615+
be updated by Google.
616+
FAILED recommendations can be marked as
617+
SUCCEEDED, or FAILED.
618+
DISMISSED (5):
619+
Recommendation is in dismissed state.
620+
Recommendation content can be updated by Google.
621+
DISMISSED recommendations can be marked as
622+
ACTIVE.
623+
"""
552624
STATE_UNSPECIFIED = 0
553625
ACTIVE = 1
554626
CLAIMED = 6

recommender-v1beta1-py.tar.gz

Whitespace-only changes.

samples/generated_samples/snippet_metadata_google.cloud.recommender.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-recommender",
11-
"version": "2.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.recommender.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-recommender",
11-
"version": "2.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)