From f89889889a0e32389a74045202beda3649efb939 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 08:11:41 -0400 Subject: [PATCH] chore: use gapic-generator-python 0.65.2 (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 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 Co-authored-by: Anthonios Partheniou --- .../services/fleet_routing/async_client.py | 12 ++++++------ .../gapic/optimization_v1/test_fleet_routing.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py b/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py index 9733d8485a48..02c0e5be87cd 100644 --- a/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py +++ b/packages/google-cloud-optimization/google/cloud/optimization_v1/services/fleet_routing/async_client.py @@ -250,9 +250,9 @@ async def optimize_tours( from google.cloud import optimization_v1 - def sample_optimize_tours(): + async def sample_optimize_tours(): # Create a client - client = optimization_v1.FleetRoutingClient() + client = optimization_v1.FleetRoutingAsyncClient() # Initialize request argument(s) request = optimization_v1.OptimizeToursRequest( @@ -260,7 +260,7 @@ def sample_optimize_tours(): ) # Make the request - response = client.optimize_tours(request=request) + response = await client.optimize_tours(request=request) # Handle the response print(response) @@ -346,9 +346,9 @@ async def batch_optimize_tours( from google.cloud import optimization_v1 - def sample_batch_optimize_tours(): + async def sample_batch_optimize_tours(): # Create a client - client = optimization_v1.FleetRoutingClient() + client = optimization_v1.FleetRoutingAsyncClient() # Initialize request argument(s) model_configs = optimization_v1.AsyncModelConfig() @@ -365,7 +365,7 @@ def sample_batch_optimize_tours(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py b/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py index cc06eb204e9d..095676b7cf11 100644 --- a/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py +++ b/packages/google-cloud-optimization/tests/unit/gapic/optimization_v1/test_fleet_routing.py @@ -742,7 +742,7 @@ def test_optimize_tours_field_headers(): # a field header. Set these to a non-empty value. request = fleet_routing.OptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: @@ -758,7 +758,7 @@ def test_optimize_tours_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -772,7 +772,7 @@ async def test_optimize_tours_field_headers_async(): # a field header. Set these to a non-empty value. request = fleet_routing.OptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: @@ -790,7 +790,7 @@ async def test_optimize_tours_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -893,7 +893,7 @@ def test_batch_optimize_tours_field_headers(): # a field header. Set these to a non-empty value. request = fleet_routing.BatchOptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -911,7 +911,7 @@ def test_batch_optimize_tours_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -925,7 +925,7 @@ async def test_batch_optimize_tours_field_headers_async(): # a field header. Set these to a non-empty value. request = fleet_routing.BatchOptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -945,7 +945,7 @@ async def test_batch_optimize_tours_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"]