diff --git a/google/cloud/shell_v1/services/cloud_shell_service/async_client.py b/google/cloud/shell_v1/services/cloud_shell_service/async_client.py index c6b278d..7629943 100644 --- a/google/cloud/shell_v1/services/cloud_shell_service/async_client.py +++ b/google/cloud/shell_v1/services/cloud_shell_service/async_client.py @@ -231,9 +231,9 @@ async def get_environment( from google.cloud import shell_v1 - def sample_get_environment(): + async def sample_get_environment(): # Create a client - client = shell_v1.CloudShellServiceClient() + client = shell_v1.CloudShellServiceAsyncClient() # Initialize request argument(s) request = shell_v1.GetEnvironmentRequest( @@ -241,7 +241,7 @@ def sample_get_environment(): ) # Make the request - response = client.get_environment(request=request) + response = await client.get_environment(request=request) # Handle the response print(response) @@ -349,9 +349,9 @@ async def start_environment( from google.cloud import shell_v1 - def sample_start_environment(): + async def sample_start_environment(): # Create a client - client = shell_v1.CloudShellServiceClient() + client = shell_v1.CloudShellServiceAsyncClient() # Initialize request argument(s) request = shell_v1.StartEnvironmentRequest( @@ -362,7 +362,7 @@ def sample_start_environment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -440,9 +440,9 @@ async def authorize_environment( from google.cloud import shell_v1 - def sample_authorize_environment(): + async def sample_authorize_environment(): # Create a client - client = shell_v1.CloudShellServiceClient() + client = shell_v1.CloudShellServiceAsyncClient() # Initialize request argument(s) request = shell_v1.AuthorizeEnvironmentRequest( @@ -453,7 +453,7 @@ def sample_authorize_environment(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -529,9 +529,9 @@ async def add_public_key( from google.cloud import shell_v1 - def sample_add_public_key(): + async def sample_add_public_key(): # Create a client - client = shell_v1.CloudShellServiceClient() + client = shell_v1.CloudShellServiceAsyncClient() # Initialize request argument(s) request = shell_v1.AddPublicKeyRequest( @@ -542,7 +542,7 @@ def sample_add_public_key(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -620,9 +620,9 @@ async def remove_public_key( from google.cloud import shell_v1 - def sample_remove_public_key(): + async def sample_remove_public_key(): # Create a client - client = shell_v1.CloudShellServiceClient() + client = shell_v1.CloudShellServiceAsyncClient() # Initialize request argument(s) request = shell_v1.RemovePublicKeyRequest( @@ -633,7 +633,7 @@ def sample_remove_public_key(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/tests/unit/gapic/shell_v1/test_cloud_shell_service.py b/tests/unit/gapic/shell_v1/test_cloud_shell_service.py index e0ad7c2..6341376 100644 --- a/tests/unit/gapic/shell_v1/test_cloud_shell_service.py +++ b/tests/unit/gapic/shell_v1/test_cloud_shell_service.py @@ -798,7 +798,7 @@ def test_get_environment_field_headers(): # a field header. Set these to a non-empty value. request = cloudshell.GetEnvironmentRequest() - 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_environment), "__call__") as call: @@ -814,7 +814,7 @@ def test_get_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -828,7 +828,7 @@ async def test_get_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudshell.GetEnvironmentRequest() - 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_environment), "__call__") as call: @@ -846,7 +846,7 @@ async def test_get_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1030,7 +1030,7 @@ def test_start_environment_field_headers(): # a field header. Set these to a non-empty value. request = cloudshell.StartEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1048,7 +1048,7 @@ def test_start_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1062,7 +1062,7 @@ async def test_start_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudshell.StartEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1082,7 +1082,7 @@ async def test_start_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1184,7 +1184,7 @@ def test_authorize_environment_field_headers(): # a field header. Set these to a non-empty value. request = cloudshell.AuthorizeEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1202,7 +1202,7 @@ def test_authorize_environment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1216,7 +1216,7 @@ async def test_authorize_environment_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudshell.AuthorizeEnvironmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1236,7 +1236,7 @@ async def test_authorize_environment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1332,7 +1332,7 @@ def test_add_public_key_field_headers(): # a field header. Set these to a non-empty value. request = cloudshell.AddPublicKeyRequest() - request.environment = "environment/value" + request.environment = "environment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.add_public_key), "__call__") as call: @@ -1348,7 +1348,7 @@ def test_add_public_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "environment=environment/value", + "environment=environment_value", ) in kw["metadata"] @@ -1362,7 +1362,7 @@ async def test_add_public_key_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudshell.AddPublicKeyRequest() - request.environment = "environment/value" + request.environment = "environment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.add_public_key), "__call__") as call: @@ -1380,7 +1380,7 @@ async def test_add_public_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "environment=environment/value", + "environment=environment_value", ) in kw["metadata"] @@ -1482,7 +1482,7 @@ def test_remove_public_key_field_headers(): # a field header. Set these to a non-empty value. request = cloudshell.RemovePublicKeyRequest() - request.environment = "environment/value" + request.environment = "environment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1500,7 +1500,7 @@ def test_remove_public_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "environment=environment/value", + "environment=environment_value", ) in kw["metadata"] @@ -1514,7 +1514,7 @@ async def test_remove_public_key_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudshell.RemovePublicKeyRequest() - request.environment = "environment/value" + request.environment = "environment_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1534,7 +1534,7 @@ async def test_remove_public_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "environment=environment/value", + "environment=environment_value", ) in kw["metadata"]