Skip to content

Commit

Permalink
docs: Add documentation for enums (#407)
Browse files Browse the repository at this point in the history
* 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: googleapis/googleapis-gen@0080f83
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jan 20, 2023
1 parent 0ec436b commit 26a0749
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def sample_update_group():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "ErrorGroupServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def sample_delete_events():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "ErrorStatsServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def sample_report_error_event():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "ReportErrorsServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
21 changes: 20 additions & 1 deletion google/cloud/errorreporting_v1beta1/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,26 @@


class ResolutionStatus(proto.Enum):
r"""Resolution status of an error group."""
r"""Resolution status of an error group.
Values:
RESOLUTION_STATUS_UNSPECIFIED (0):
Status is unknown. When left unspecified in
requests, it is treated like OPEN.
OPEN (1):
The error group is not being addressed. This
is the default for new groups. It is also used
for errors re-occurring after marked RESOLVED.
ACKNOWLEDGED (2):
Error Group manually acknowledged, it can
have an issue link attached.
RESOLVED (3):
Error Group manually resolved, more events
for this group are not expected to occur.
MUTED (4):
The error group is muted and excluded by
default on group stats requests.
"""
RESOLUTION_STATUS_UNSPECIFIED = 0
OPEN = 1
ACKNOWLEDGED = 2
Expand Down
63 changes: 61 additions & 2 deletions google/cloud/errorreporting_v1beta1/types/error_stats_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,50 @@
class TimedCountAlignment(proto.Enum):
r"""Specifies how the time periods of error group counts are
aligned.
Values:
ERROR_COUNT_ALIGNMENT_UNSPECIFIED (0):
No alignment specified.
ALIGNMENT_EQUAL_ROUNDED (1):
The time periods shall be consecutive, have width equal to
the requested duration, and be aligned at the
``alignment_time`` provided in the request. The
``alignment_time`` does not have to be inside the query
period but even if it is outside, only time periods are
returned which overlap with the query period. A rounded
alignment will typically result in a different size of the
first or the last time period.
ALIGNMENT_EQUAL_AT_END (2):
The time periods shall be consecutive, have
width equal to the requested duration, and be
aligned at the end of the requested time period.
This can result in a different size of the first
time period.
"""
ERROR_COUNT_ALIGNMENT_UNSPECIFIED = 0
ALIGNMENT_EQUAL_ROUNDED = 1
ALIGNMENT_EQUAL_AT_END = 2


class ErrorGroupOrder(proto.Enum):
r"""A sorting order of error groups."""
r"""A sorting order of error groups.
Values:
GROUP_ORDER_UNSPECIFIED (0):
No group order specified.
COUNT_DESC (1):
Total count of errors in the given time
window in descending order.
LAST_SEEN_DESC (2):
Timestamp when the group was last seen in the
given time window in descending order.
CREATED_DESC (3):
Timestamp when the group was created in
descending order.
AFFECTED_USERS_DESC (4):
Number of affected users in the given time
window in descending order.
"""
GROUP_ORDER_UNSPECIFIED = 0
COUNT_DESC = 1
LAST_SEEN_DESC = 2
Expand Down Expand Up @@ -440,7 +476,30 @@ class QueryTimeRange(proto.Message):
"""

class Period(proto.Enum):
r"""The supported time ranges."""
r"""The supported time ranges.
Values:
PERIOD_UNSPECIFIED (0):
Do not use.
PERIOD_1_HOUR (1):
Retrieve data for the last hour.
Recommended minimum timed count duration: 1 min.
PERIOD_6_HOURS (2):
Retrieve data for the last 6 hours.
Recommended minimum timed count duration: 10
min.
PERIOD_1_DAY (3):
Retrieve data for the last day.
Recommended minimum timed count duration: 1
hour.
PERIOD_1_WEEK (4):
Retrieve data for the last week.
Recommended minimum timed count duration: 6
hours.
PERIOD_30_DAYS (5):
Retrieve data for the last 30 days.
Recommended minimum timed count duration: 1 day.
"""
PERIOD_UNSPECIFIED = 0
PERIOD_1_HOUR = 1
PERIOD_6_HOURS = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-error-reporting",
"version": "1.8.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 26a0749

Please sign in to comment.