Skip to content

Commit 8e9a62b

Browse files
docs: Add documentation for enums (#250)
* 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>
1 parent c2c248b commit 8e9a62b

File tree

8 files changed

+419
-12
lines changed

8 files changed

+419
-12
lines changed

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/services/dashboards_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ def sample_update_dashboard():
906906
# Done; return the response.
907907
return response
908908

909-
def __enter__(self):
909+
def __enter__(self) -> "DashboardsServiceClient":
910910
return self
911911

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

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/common.py

Lines changed: 270 additions & 2 deletions
Large diffs are not rendered by default.

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/dashboard_filter.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,23 @@ class DashboardFilter(proto.Message):
5050
"""
5151

5252
class FilterType(proto.Enum):
53-
r"""The type for the dashboard filter"""
53+
r"""The type for the dashboard filter
54+
55+
Values:
56+
FILTER_TYPE_UNSPECIFIED (0):
57+
Filter type is unspecified. This is not valid
58+
in a well-formed request.
59+
RESOURCE_LABEL (1):
60+
Filter on a resource label value
61+
METRIC_LABEL (2):
62+
Filter on a metrics label value
63+
USER_METADATA_LABEL (3):
64+
Filter on a user metadata label value
65+
SYSTEM_METADATA_LABEL (4):
66+
Filter on a system metadata label value
67+
GROUP (5):
68+
Filter on a group id
69+
"""
5470
FILTER_TYPE_UNSPECIFIED = 0
5571
RESOURCE_LABEL = 1
5672
METRIC_LABEL = 2

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/metrics.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
3535
class SparkChartType(proto.Enum):
3636
r"""Defines the possible types of spark chart supported by the
3737
``Scorecard``.
38+
39+
Values:
40+
SPARK_CHART_TYPE_UNSPECIFIED (0):
41+
Not allowed in well-formed requests.
42+
SPARK_LINE (1):
43+
The sparkline will be rendered as a small
44+
line chart.
45+
SPARK_BAR (2):
46+
The sparkbar will be rendered as a small bar
47+
chart.
3848
"""
3949
SPARK_CHART_TYPE_UNSPECIFIED = 0
4050
SPARK_LINE = 1
@@ -286,6 +296,17 @@ class Color(proto.Enum):
286296
actual values cross the threshold. Comments on each color
287297
provide UX guidance on how users can be expected to interpret a
288298
given state color.
299+
300+
Values:
301+
COLOR_UNSPECIFIED (0):
302+
Color is unspecified. Not allowed in
303+
well-formed requests.
304+
YELLOW (4):
305+
Crossing the threshold is "concerning"
306+
behavior.
307+
RED (6):
308+
Crossing the threshold is "emergency"
309+
behavior.
289310
"""
290311
COLOR_UNSPECIFIED = 0
291312
YELLOW = 4
@@ -294,13 +315,33 @@ class Color(proto.Enum):
294315
class Direction(proto.Enum):
295316
r"""Whether the threshold is considered crossed by an actual
296317
value above or below its threshold value.
318+
319+
Values:
320+
DIRECTION_UNSPECIFIED (0):
321+
Not allowed in well-formed requests.
322+
ABOVE (1):
323+
The threshold will be considered crossed if
324+
the actual value is above the threshold value.
325+
BELOW (2):
326+
The threshold will be considered crossed if
327+
the actual value is below the threshold value.
297328
"""
298329
DIRECTION_UNSPECIFIED = 0
299330
ABOVE = 1
300331
BELOW = 2
301332

302333
class TargetAxis(proto.Enum):
303-
r"""An axis identifier."""
334+
r"""An axis identifier.
335+
336+
Values:
337+
TARGET_AXIS_UNSPECIFIED (0):
338+
The target axis was not specified. Defaults
339+
to Y1.
340+
Y1 (1):
341+
The y_axis (the right axis of chart).
342+
Y2 (2):
343+
The y2_axis (the left axis of chart).
344+
"""
304345
TARGET_AXIS_UNSPECIFIED = 0
305346
Y1 = 1
306347
Y2 = 2

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/table.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,16 @@ class TimeSeriesTable(proto.Message):
4646
"""
4747

4848
class MetricVisualization(proto.Enum):
49-
r"""Enum for metric metric_visualization"""
49+
r"""Enum for metric metric_visualization
50+
51+
Values:
52+
METRIC_VISUALIZATION_UNSPECIFIED (0):
53+
Unspecified state
54+
NUMBER (1):
55+
Default text rendering
56+
BAR (2):
57+
Horizontal bar rendering
58+
"""
5059
METRIC_VISUALIZATION_UNSPECIFIED = 0
5160
NUMBER = 1
5261
BAR = 2

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/text.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@ class Text(proto.Message):
3737
"""
3838

3939
class Format(proto.Enum):
40-
r"""The format type of the text content."""
40+
r"""The format type of the text content.
41+
42+
Values:
43+
FORMAT_UNSPECIFIED (0):
44+
Format is unspecified. Defaults to MARKDOWN.
45+
MARKDOWN (1):
46+
The text contains Markdown formatting.
47+
RAW (2):
48+
The text contains no special formatting.
49+
"""
4150
FORMAT_UNSPECIFIED = 0
4251
MARKDOWN = 1
4352
RAW = 2

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/xychart.py

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,54 @@ class DataSet(proto.Message):
8585
"""
8686

8787
class PlotType(proto.Enum):
88-
r"""The types of plotting strategies for data sets."""
88+
r"""The types of plotting strategies for data sets.
89+
90+
Values:
91+
PLOT_TYPE_UNSPECIFIED (0):
92+
Plot type is unspecified. The view will default to ``LINE``.
93+
LINE (1):
94+
The data is plotted as a set of lines (one
95+
line per series).
96+
STACKED_AREA (2):
97+
The data is plotted as a set of filled areas
98+
(one area per series), with the areas stacked
99+
vertically (the base of each area is the top of
100+
its predecessor, and the base of the first area
101+
is the X axis). Since the areas do not overlap,
102+
each is filled with a different opaque color.
103+
STACKED_BAR (3):
104+
The data is plotted as a set of rectangular
105+
boxes (one box per series), with the boxes
106+
stacked vertically (the base of each box is the
107+
top of its predecessor, and the base of the
108+
first box is the X axis). Since the boxes do not
109+
overlap, each is filled with a different opaque
110+
color.
111+
HEATMAP (4):
112+
The data is plotted as a heatmap. The series being plotted
113+
must have a ``DISTRIBUTION`` value type. The value of each
114+
bucket in the distribution is displayed as a color. This
115+
type is not currently available in the Stackdriver
116+
Monitoring application.
117+
"""
89118
PLOT_TYPE_UNSPECIFIED = 0
90119
LINE = 1
91120
STACKED_AREA = 2
92121
STACKED_BAR = 3
93122
HEATMAP = 4
94123

95124
class TargetAxis(proto.Enum):
96-
r"""An axis identifier."""
125+
r"""An axis identifier.
126+
127+
Values:
128+
TARGET_AXIS_UNSPECIFIED (0):
129+
The target axis was not specified. Defaults
130+
to Y1.
131+
Y1 (1):
132+
The y_axis (the right axis of chart).
133+
Y2 (2):
134+
The y2_axis (the left axis of chart).
135+
"""
97136
TARGET_AXIS_UNSPECIFIED = 0
98137
Y1 = 1
99138
Y2 = 2
@@ -135,7 +174,16 @@ class Axis(proto.Message):
135174
"""
136175

137176
class Scale(proto.Enum):
138-
r"""Types of scales used in axes."""
177+
r"""Types of scales used in axes.
178+
179+
Values:
180+
SCALE_UNSPECIFIED (0):
181+
Scale is unspecified. The view will default to ``LINEAR``.
182+
LINEAR (1):
183+
Linear scale.
184+
LOG10 (2):
185+
Logarithmic scale (base 10).
186+
"""
139187
SCALE_UNSPECIFIED = 0
140188
LINEAR = 1
141189
LOG10 = 2
@@ -196,7 +244,23 @@ class ChartOptions(proto.Message):
196244
"""
197245

198246
class Mode(proto.Enum):
199-
r"""Chart mode options."""
247+
r"""Chart mode options.
248+
249+
Values:
250+
MODE_UNSPECIFIED (0):
251+
Mode is unspecified. The view will default to ``COLOR``.
252+
COLOR (1):
253+
The chart distinguishes data series using
254+
different color. Line colors may get reused when
255+
there are many lines in the chart.
256+
X_RAY (2):
257+
The chart uses the Stackdriver x-ray mode, in
258+
which each data set is plotted using the same
259+
semi-transparent color.
260+
STATS (3):
261+
The chart displays statistics such as
262+
average, median, 95th percentile, and more.
263+
"""
200264
MODE_UNSPECIFIED = 0
201265
COLOR = 1
202266
X_RAY = 2

packages/google-cloud-monitoring-dashboards/samples/generated_samples/snippet_metadata_google.monitoring.dashboard.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-monitoring-dashboards",
11-
"version": "2.11.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)