From ad08285b3881e98b8b922621a588f451da580e4e 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 07:22:37 -0400 Subject: [PATCH] chore: use gapic-generator-python 0.65.2 (#203) 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 --- .../services/budget_service/async_client.py | 30 ++++++------- .../services/budget_service/async_client.py | 30 ++++++------- .../gapic/budgets_v1/test_budget_service.py | 42 +++++++++---------- .../budgets_v1beta1/test_budget_service.py | 42 +++++++++---------- 4 files changed, 72 insertions(+), 72 deletions(-) diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py index 0c5c759a7094..1279ebdbc08c 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py @@ -227,9 +227,9 @@ async def create_budget( from google.cloud.billing import budgets_v1 - def sample_create_budget(): + async def sample_create_budget(): # Create a client - client = budgets_v1.BudgetServiceClient() + client = budgets_v1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1.CreateBudgetRequest( @@ -237,7 +237,7 @@ def sample_create_budget(): ) # Make the request - response = client.create_budget(request=request) + response = await client.create_budget(request=request) # Handle the response print(response) @@ -341,16 +341,16 @@ async def update_budget( from google.cloud.billing import budgets_v1 - def sample_update_budget(): + async def sample_update_budget(): # Create a client - client = budgets_v1.BudgetServiceClient() + client = budgets_v1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1.UpdateBudgetRequest( ) # Make the request - response = client.update_budget(request=request) + response = await client.update_budget(request=request) # Handle the response print(response) @@ -472,9 +472,9 @@ async def get_budget( from google.cloud.billing import budgets_v1 - def sample_get_budget(): + async def sample_get_budget(): # Create a client - client = budgets_v1.BudgetServiceClient() + client = budgets_v1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1.GetBudgetRequest( @@ -482,7 +482,7 @@ def sample_get_budget(): ) # Make the request - response = client.get_budget(request=request) + response = await client.get_budget(request=request) # Handle the response print(response) @@ -588,9 +588,9 @@ async def list_budgets( from google.cloud.billing import budgets_v1 - def sample_list_budgets(): + async def sample_list_budgets(): # Create a client - client = budgets_v1.BudgetServiceClient() + client = budgets_v1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1.ListBudgetsRequest( @@ -601,7 +601,7 @@ def sample_list_budgets(): page_result = client.list_budgets(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -706,9 +706,9 @@ async def delete_budget( from google.cloud.billing import budgets_v1 - def sample_delete_budget(): + async def sample_delete_budget(): # Create a client - client = budgets_v1.BudgetServiceClient() + client = budgets_v1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1.DeleteBudgetRequest( @@ -716,7 +716,7 @@ def sample_delete_budget(): ) # Make the request - client.delete_budget(request=request) + await client.delete_budget(request=request) Args: request (Union[google.cloud.billing.budgets_v1.types.DeleteBudgetRequest, dict]): diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py index 4e4091f03eaf..0e7b7a000eb6 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py @@ -223,9 +223,9 @@ async def create_budget( from google.cloud.billing import budgets_v1beta1 - def sample_create_budget(): + async def sample_create_budget(): # Create a client - client = budgets_v1beta1.BudgetServiceClient() + client = budgets_v1beta1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1beta1.CreateBudgetRequest( @@ -233,7 +233,7 @@ def sample_create_budget(): ) # Make the request - response = client.create_budget(request=request) + response = await client.create_budget(request=request) # Handle the response print(response) @@ -306,16 +306,16 @@ async def update_budget( from google.cloud.billing import budgets_v1beta1 - def sample_update_budget(): + async def sample_update_budget(): # Create a client - client = budgets_v1beta1.BudgetServiceClient() + client = budgets_v1beta1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1beta1.UpdateBudgetRequest( ) # Make the request - response = client.update_budget(request=request) + response = await client.update_budget(request=request) # Handle the response print(response) @@ -401,9 +401,9 @@ async def get_budget( from google.cloud.billing import budgets_v1beta1 - def sample_get_budget(): + async def sample_get_budget(): # Create a client - client = budgets_v1beta1.BudgetServiceClient() + client = budgets_v1beta1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1beta1.GetBudgetRequest( @@ -411,7 +411,7 @@ def sample_get_budget(): ) # Make the request - response = client.get_budget(request=request) + response = await client.get_budget(request=request) # Handle the response print(response) @@ -495,9 +495,9 @@ async def list_budgets( from google.cloud.billing import budgets_v1beta1 - def sample_list_budgets(): + async def sample_list_budgets(): # Create a client - client = budgets_v1beta1.BudgetServiceClient() + client = budgets_v1beta1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1beta1.ListBudgetsRequest( @@ -508,7 +508,7 @@ def sample_list_budgets(): page_result = client.list_budgets(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -590,9 +590,9 @@ async def delete_budget( from google.cloud.billing import budgets_v1beta1 - def sample_delete_budget(): + async def sample_delete_budget(): # Create a client - client = budgets_v1beta1.BudgetServiceClient() + client = budgets_v1beta1.BudgetServiceAsyncClient() # Initialize request argument(s) request = budgets_v1beta1.DeleteBudgetRequest( @@ -600,7 +600,7 @@ def sample_delete_budget(): ) # Make the request - client.delete_budget(request=request) + await client.delete_budget(request=request) Args: request (Union[google.cloud.billing.budgets_v1beta1.types.DeleteBudgetRequest, dict]): diff --git a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py index d7897c34725e..d9c28e7d040c 100644 --- a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py +++ b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py @@ -756,7 +756,7 @@ def test_create_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.CreateBudgetRequest() - 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.create_budget), "__call__") as call: @@ -772,7 +772,7 @@ def test_create_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -786,7 +786,7 @@ async def test_create_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.CreateBudgetRequest() - 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.create_budget), "__call__") as call: @@ -802,7 +802,7 @@ async def test_create_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1002,7 +1002,7 @@ def test_update_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.UpdateBudgetRequest() - request.budget.name = "budget.name/value" + request.budget.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_budget), "__call__") as call: @@ -1018,7 +1018,7 @@ def test_update_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "budget.name=budget.name/value", + "budget.name=name_value", ) in kw["metadata"] @@ -1032,7 +1032,7 @@ async def test_update_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.UpdateBudgetRequest() - request.budget.name = "budget.name/value" + request.budget.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_budget), "__call__") as call: @@ -1048,7 +1048,7 @@ async def test_update_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "budget.name=budget.name/value", + "budget.name=name_value", ) in kw["metadata"] @@ -1248,7 +1248,7 @@ def test_get_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.GetBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_budget), "__call__") as call: @@ -1264,7 +1264,7 @@ def test_get_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1278,7 +1278,7 @@ async def test_get_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.GetBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_budget), "__call__") as call: @@ -1294,7 +1294,7 @@ async def test_get_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1476,7 +1476,7 @@ def test_list_budgets_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.ListBudgetsRequest() - 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.list_budgets), "__call__") as call: @@ -1492,7 +1492,7 @@ def test_list_budgets_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1506,7 +1506,7 @@ async def test_list_budgets_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.ListBudgetsRequest() - 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.list_budgets), "__call__") as call: @@ -1524,7 +1524,7 @@ async def test_list_budgets_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1655,7 +1655,7 @@ def test_list_budgets_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, budget_model.Budget) for i in results) @@ -1888,7 +1888,7 @@ def test_delete_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.DeleteBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_budget), "__call__") as call: @@ -1904,7 +1904,7 @@ def test_delete_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1918,7 +1918,7 @@ async def test_delete_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.DeleteBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_budget), "__call__") as call: @@ -1934,7 +1934,7 @@ async def test_delete_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py index 91c41515b65c..c691f0fc4a1f 100644 --- a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py +++ b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py @@ -756,7 +756,7 @@ def test_create_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.CreateBudgetRequest() - 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.create_budget), "__call__") as call: @@ -772,7 +772,7 @@ def test_create_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -786,7 +786,7 @@ async def test_create_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.CreateBudgetRequest() - 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.create_budget), "__call__") as call: @@ -802,7 +802,7 @@ async def test_create_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -912,7 +912,7 @@ def test_update_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.UpdateBudgetRequest() - request.budget.name = "budget.name/value" + request.budget.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_budget), "__call__") as call: @@ -928,7 +928,7 @@ def test_update_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "budget.name=budget.name/value", + "budget.name=name_value", ) in kw["metadata"] @@ -942,7 +942,7 @@ async def test_update_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.UpdateBudgetRequest() - request.budget.name = "budget.name/value" + request.budget.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_budget), "__call__") as call: @@ -958,7 +958,7 @@ async def test_update_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "budget.name=budget.name/value", + "budget.name=name_value", ) in kw["metadata"] @@ -1068,7 +1068,7 @@ def test_get_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.GetBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_budget), "__call__") as call: @@ -1084,7 +1084,7 @@ def test_get_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1098,7 +1098,7 @@ async def test_get_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.GetBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_budget), "__call__") as call: @@ -1114,7 +1114,7 @@ async def test_get_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1216,7 +1216,7 @@ def test_list_budgets_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.ListBudgetsRequest() - 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.list_budgets), "__call__") as call: @@ -1232,7 +1232,7 @@ def test_list_budgets_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1246,7 +1246,7 @@ async def test_list_budgets_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.ListBudgetsRequest() - 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.list_budgets), "__call__") as call: @@ -1264,7 +1264,7 @@ async def test_list_budgets_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1313,7 +1313,7 @@ def test_list_budgets_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, budget_model.Budget) for i in results) @@ -1546,7 +1546,7 @@ def test_delete_budget_field_headers(): # a field header. Set these to a non-empty value. request = budget_service.DeleteBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_budget), "__call__") as call: @@ -1562,7 +1562,7 @@ def test_delete_budget_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1576,7 +1576,7 @@ async def test_delete_budget_field_headers_async(): # a field header. Set these to a non-empty value. request = budget_service.DeleteBudgetRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_budget), "__call__") as call: @@ -1592,7 +1592,7 @@ async def test_delete_budget_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"]