Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.65.2 (#219)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.65.2

PiperOrigin-RevId: 444333013

Source-Link: googleapis/googleapis@f91b6cf

Source-Link: googleapis/googleapis-gen@16eb360
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9

* 🦉 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 Apr 28, 2022
1 parent fb3d793 commit 5330f12
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ async def list_traces(
from google.cloud import trace_v1
def sample_list_traces():
async def sample_list_traces():
# Create a client
client = trace_v1.TraceServiceClient()
client = trace_v1.TraceServiceAsyncClient()
# Initialize request argument(s)
request = trace_v1.ListTracesRequest(
Expand All @@ -231,7 +231,7 @@ def sample_list_traces():
page_result = client.list_traces(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -295,6 +295,14 @@ def sample_list_traces():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -331,9 +339,9 @@ async def get_trace(
from google.cloud import trace_v1
def sample_get_trace():
async def sample_get_trace():
# Create a client
client = trace_v1.TraceServiceClient()
client = trace_v1.TraceServiceAsyncClient()
# Initialize request argument(s)
request = trace_v1.GetTraceRequest(
Expand All @@ -342,7 +350,7 @@ def sample_get_trace():
)
# Make the request
response = client.get_trace(request=request)
response = await client.get_trace(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -415,6 +423,17 @@ def sample_get_trace():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
("project_id", request.project_id),
("trace_id", request.trace_id),
)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -448,17 +467,17 @@ async def patch_traces(
from google.cloud import trace_v1
def sample_patch_traces():
async def sample_patch_traces():
# Create a client
client = trace_v1.TraceServiceClient()
client = trace_v1.TraceServiceAsyncClient()
# Initialize request argument(s)
request = trace_v1.PatchTracesRequest(
project_id="project_id_value",
)
# Make the request
client.patch_traces(request=request)
await client.patch_traces(request=request)
Args:
request (Union[google.cloud.trace_v1.types.PatchTracesRequest, dict]):
Expand Down Expand Up @@ -519,6 +538,14 @@ def sample_patch_traces():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
await rpc(
request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ def sample_list_traces():
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.list_traces]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = rpc(
request,
Expand Down Expand Up @@ -601,6 +609,17 @@ def sample_get_trace():
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.get_trace]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
("project_id", request.project_id),
("trace_id", request.trace_id),
)
),
)

# Send the request.
response = rpc(
request,
Expand Down Expand Up @@ -695,6 +714,14 @@ def sample_patch_traces():
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.patch_traces]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
rpc(
request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ async def batch_write_spans(
from google.cloud import trace_v2
def sample_batch_write_spans():
async def sample_batch_write_spans():
# Create a client
client = trace_v2.TraceServiceClient()
client = trace_v2.TraceServiceAsyncClient()
# Initialize request argument(s)
spans = trace_v2.Span()
Expand All @@ -239,7 +239,7 @@ def sample_batch_write_spans():
)
# Make the request
client.batch_write_spans(request=request)
await client.batch_write_spans(request=request)
Args:
request (Union[google.cloud.trace_v2.types.BatchWriteSpansRequest, dict]):
Expand Down Expand Up @@ -321,9 +321,9 @@ async def create_span(
from google.cloud import trace_v2
def sample_create_span():
async def sample_create_span():
# Create a client
client = trace_v2.TraceServiceClient()
client = trace_v2.TraceServiceAsyncClient()
# Initialize request argument(s)
request = trace_v2.Span(
Expand All @@ -332,7 +332,7 @@ def sample_create_span():
)
# Make the request
response = client.create_span(request=request)
response = await client.create_span(request=request)
# Handle the response
print(response)
Expand Down
Loading

0 comments on commit 5330f12

Please sign in to comment.