Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.63.2 (#182)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

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 Feb 11, 2022
1 parent c00037b commit 106aa18
Show file tree
Hide file tree
Showing 16 changed files with 1,108 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,27 @@ async def list_traces(
r"""Returns of a list of traces that match the specified
filter conditions.
.. code-block::
from google.cloud import trace_v1
def sample_list_traces():
# Create a client
client = trace_v1.TraceServiceClient()
# Initialize request argument(s)
request = trace_v1.ListTracesRequest(
project_id="project_id_value",
)
# Make the request
page_result = client.list_traces(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.trace_v1.types.ListTracesRequest, dict]):
The request object. The request message for the
Expand Down Expand Up @@ -299,6 +320,26 @@ async def get_trace(
) -> trace.Trace:
r"""Gets a single trace by its ID.
.. code-block::
from google.cloud import trace_v1
def sample_get_trace():
# Create a client
client = trace_v1.TraceServiceClient()
# Initialize request argument(s)
request = trace_v1.GetTraceRequest(
project_id="project_id_value",
trace_id="trace_id_value",
)
# Make the request
response = client.get_trace(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.trace_v1.types.GetTraceRequest, dict]):
The request object. The request message for the
Expand Down Expand Up @@ -391,6 +432,23 @@ async def patch_traces(
with the existing trace data. If the ID does not match,
a new trace is created.
.. code-block::
from google.cloud import trace_v1
def sample_patch_traces():
# Create a client
client = trace_v1.TraceServiceClient()
# Initialize request argument(s)
request = trace_v1.PatchTracesRequest(
project_id="project_id_value",
)
# Make the request
client.patch_traces(request=request)
Args:
request (Union[google.cloud.trace_v1.types.PatchTracesRequest, dict]):
The request object. The request message for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,28 @@ def list_traces(
r"""Returns of a list of traces that match the specified
filter conditions.
.. code-block::
from google.cloud import trace_v1
def sample_list_traces():
# Create a client
client = trace_v1.TraceServiceClient()
# Initialize request argument(s)
request = trace_v1.ListTracesRequest(
project_id="project_id_value",
)
# Make the request
page_result = client.list_traces(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.trace_v1.types.ListTracesRequest, dict]):
The request object. The request message for the
Expand Down Expand Up @@ -474,6 +496,27 @@ def get_trace(
) -> trace.Trace:
r"""Gets a single trace by its ID.
.. code-block::
from google.cloud import trace_v1
def sample_get_trace():
# Create a client
client = trace_v1.TraceServiceClient()
# Initialize request argument(s)
request = trace_v1.GetTraceRequest(
project_id="project_id_value",
trace_id="trace_id_value",
)
# Make the request
response = client.get_trace(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.trace_v1.types.GetTraceRequest, dict]):
The request object. The request message for the
Expand Down Expand Up @@ -556,6 +599,24 @@ def patch_traces(
with the existing trace data. If the ID does not match,
a new trace is created.
.. code-block::
from google.cloud import trace_v1
def sample_patch_traces():
# Create a client
client = trace_v1.TraceServiceClient()
# Initialize request argument(s)
request = trace_v1.PatchTracesRequest(
project_id="project_id_value",
)
# Make the request
client.patch_traces(request=request)
Args:
request (Union[google.cloud.trace_v1.types.PatchTracesRequest, dict]):
The request object. The request message for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,28 @@ async def batch_write_spans(
r"""Sends new spans to new or existing traces. You cannot
update existing spans.
.. code-block::
from google.cloud import trace_v2
def sample_batch_write_spans():
# Create a client
client = trace_v2.TraceServiceClient()
# Initialize request argument(s)
spans = trace_v2.Span()
spans.name = "name_value"
spans.span_id = "span_id_value"
request = trace_v2.BatchWriteSpansRequest(
name="name_value",
spans=spans,
)
# Make the request
client.batch_write_spans(request=request)
Args:
request (Union[google.cloud.trace_v2.types.BatchWriteSpansRequest, dict]):
The request object. The request message for the
Expand Down Expand Up @@ -293,6 +315,26 @@ async def create_span(
) -> trace.Span:
r"""Creates a new span.
.. code-block::
from google.cloud import trace_v2
def sample_create_span():
# Create a client
client = trace_v2.TraceServiceClient()
# Initialize request argument(s)
request = trace_v2.Span(
name="name_value",
span_id="span_id_value",
)
# Make the request
response = client.create_span(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.trace_v2.types.Span, dict]):
The request object. A span represents a single operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,29 @@ def batch_write_spans(
r"""Sends new spans to new or existing traces. You cannot
update existing spans.
.. code-block::
from google.cloud import trace_v2
def sample_batch_write_spans():
# Create a client
client = trace_v2.TraceServiceClient()
# Initialize request argument(s)
spans = trace_v2.Span()
spans.name = "name_value"
spans.span_id = "span_id_value"
request = trace_v2.BatchWriteSpansRequest(
name="name_value",
spans=spans,
)
# Make the request
client.batch_write_spans(request=request)
Args:
request (Union[google.cloud.trace_v2.types.BatchWriteSpansRequest, dict]):
The request object. The request message for the
Expand Down Expand Up @@ -492,6 +515,27 @@ def create_span(
) -> trace.Span:
r"""Creates a new span.
.. code-block::
from google.cloud import trace_v2
def sample_create_span():
# Create a client
client = trace_v2.TraceServiceClient()
# Initialize request argument(s)
request = trace_v2.Span(
name="name_value",
span_id="span_id_value",
)
# Make the request
response = client.create_span(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.trace_v2.types.Span, dict]):
The request object. A span represents a single operation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for GetTrace
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-trace


# [START cloudtrace_generated_trace_v1_TraceService_GetTrace_async]
from google.cloud import trace_v1


async def sample_get_trace():
# Create a client
client = trace_v1.TraceServiceAsyncClient()

# Initialize request argument(s)
request = trace_v1.GetTraceRequest(
project_id="project_id_value",
trace_id="trace_id_value",
)

# Make the request
response = await client.get_trace(request=request)

# Handle the response
print(response)

# [END cloudtrace_generated_trace_v1_TraceService_GetTrace_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for GetTrace
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-trace


# [START cloudtrace_generated_trace_v1_TraceService_GetTrace_sync]
from google.cloud import trace_v1


def sample_get_trace():
# Create a client
client = trace_v1.TraceServiceClient()

# Initialize request argument(s)
request = trace_v1.GetTraceRequest(
project_id="project_id_value",
trace_id="trace_id_value",
)

# Make the request
response = client.get_trace(request=request)

# Handle the response
print(response)

# [END cloudtrace_generated_trace_v1_TraceService_GetTrace_sync]
Loading

0 comments on commit 106aa18

Please sign in to comment.