Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions google/cloud/shell_v1/services/cloud_shell_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,17 @@ 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(
name="name_value",
)

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

# Handle the response
print(response)
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down
40 changes: 20 additions & 20 deletions tests/unit/gapic/shell_v1/test_cloud_shell_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"]


Expand All @@ -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:
Expand All @@ -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"]


Expand Down Expand Up @@ -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(
Expand All @@ -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"]


Expand All @@ -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(
Expand All @@ -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"]


Expand Down Expand Up @@ -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(
Expand All @@ -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"]


Expand All @@ -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(
Expand All @@ -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"]


Expand Down Expand Up @@ -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:
Expand All @@ -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"]


Expand All @@ -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:
Expand All @@ -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"]


Expand Down Expand Up @@ -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(
Expand All @@ -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"]


Expand All @@ -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(
Expand All @@ -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"]


Expand Down