10000 docs: Add documentation for enums (#291) · googleapis/google-cloud-python@9190738 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9190738

Browse files
docs: Add documentation for enums (#291)
* 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 15c9cd8 commit 9190738

File tree

6 files changed

+84
-6
lines changed

6 files changed

+84
-6
lines changed

packages/google-cloud-trace/google/cloud/trace_v1/services/trace_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def sample_patch_traces():
766766
metadata=metadata,
767767
)
768768

769-
def __enter__(self):
769+
def __enter__(self) -> "TraceServiceClient":
770770
return self
771771

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

packages/google-cloud-trace/google/cloud/trace_v1/types/trace.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ class TraceSpan(proto.Message):
157157
class SpanKind(proto.Enum):
158158
r"""Type of span. Can be used to specify additional relationships
159159
between spans in addition to a parent/child relationship.
160+
161+
Values:
162+
SPAN_KIND_UNSPECIFIED (0):
163+
Unspecified.
164+
RPC_SERVER (1):
165+
Indicates that the span covers server-side
166+
handling of an RPC or other remote network
167+
request.
168+
RPC_CLIENT (2):
169+
Indicates that the span covers the
170+
client-side wrapper around an RPC or other
171+
remote request.
160172
"""
161173
SPAN_KIND_UNSPECIFIED = 0
162174
RPC_SERVER = 1
@@ -276,7 +288,24 @@ class ListTracesRequest(proto.Message):
276288
"""
277289

278290
class ViewType(proto.Enum):
279-
r"""Type of data returned for traces in the list."""
291+
r"""Type of data returned for traces in the list.
292+
293+
Values:
294+
VIEW_TYPE_UNSPECIFIED (0):
295+
Default is ``MINIMAL`` if unspecified.
296+
MINIMAL (1):
297+
Minimal view of the trace record that
298+
contains only the project and trace IDs.
299+
ROOTSPAN (2):
300+
Root span view of the trace record that
301+
returns the root spans along with the minimal
302+
trace data.
303+
COMPLETE (3):
304+
Complete view of the trace record that contains the actual
305+
trace data. This is equivalent to calling the REST ``get``
306+
or RPC ``GetTrace`` method using the ID of each listed
307+
trace.
308+
"""
280309
VIEW_TYPE_UNSPECIFIED = 0
281310
MINIMAL = 1
282311
ROOTSPAN = 2

packages/google-cloud-trace/google/cloud/trace_v2/services/trace_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ def sample_create_span():
651651
# Done; return the response.
652652
return response
653653

654-
def __enter__(self):
654+
def __enter__(self) -> "TraceServiceClient":
655655
return self
656656

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

packages/google-cloud-trace/google/cloud/trace_v2/types/trace.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,36 @@ class Span(proto.Message):
121121
class SpanKind(proto.Enum):
122122
r"""Type of span. Can be used to specify additional relationships
123123
between spans in addition to a parent/child relationship.
124+
125+
Values:
126+
SPAN_KIND_UNSPECIFIED (0):
127+
Unspecified. Do NOT use as default.
128+
Implementations MAY assume SpanKind.INTERNAL to
129+
be default.
130+
INTERNAL (1):
131+
Indicates that the span is used internally.
132+
Default value.
133+
SERVER (2):
134+
Indicates that the span covers server-side
135+
handling of an RPC or other remote network
136+
request.
137+
CLIENT (3):
138+
Indicates that the span covers the
139+
client-side wrapper around an RPC or other
140+
remote request.
141+
PRODUCER (4):
142+
Indicates that the span describes producer
143+
sending a message to a broker. Unlike client and
144+
server, there is no direct critical path latency
145+
relationship between producer and consumer spans
146+
(e.g. publishing a message to a pubsub service).
147+
CONSUMER (5):
148+
Indicates that the span describes consumer
149+
receiving a message from a broker. Unlike client
150+
and server, there is no direct critical path
151+
latency relationship between producer and
152+
consumer spans (e.g. receiving a message from a
153+
pubsub service subscription).
124154
"""
125155
SPAN_KIND_UNSPECIFIED = 0
126156
INTERNAL = 1
@@ -234,7 +264,16 @@ class MessageEvent(proto.Message):
234264
"""
235265

236266
class Type(proto.Enum):
237-
r"""Indicates whether the message was sent or received."""
267+
r"""Indicates whether the message was sent or received.
268+
269+
Values:
270+
TYPE_UNSPECIFIED (0):
271+
Unknown event type.
272+
SENT (1):
273+
Indicates a sent message.
274+
RECEIVED (2):
275+
Indicates a received message.
276+
"""
238277
TYPE_UNSPECIFIED = 0
239278
SENT = 1
240279
RECEIVED = 2
@@ -330,6 +369,16 @@ class Link(proto.Message):
330369
class Type(proto.Enum):
331370
r"""The relationship of the current span relative to the linked
332371
span: child, parent, or unspecified.
372+
373+
Values:
374+
TYPE_UNSPECIFIED (0):
375+
The relationship of the two spans is unknown.
376+
CHILD_LINKED_SPAN (1):
377+
The linked span is a child of the current
378+
span.
379+
PARENT_LINKED_SPAN (2):
380+
The linked span is a parent of the current
381+
span.
333382
"""
334383
TYPE_UNSPECIFIED = 0
335384
CHILD_LINKED_SPAN = 1

packages/google-cloud-trace/samples/generated_samples/snippet_metadata_google.devtools.cloudtrace.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-trace",
11-
"version": "1.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-trace/samples/generated_samples/snippet_metadata_google.devtools.cloudtrace.v2.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-trace",
11-
"version": "1.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)
0