Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.65.2 (#14)
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 c54fe20 commit 1feed4f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ async def get_revision(
from google.cloud import run_v2
def sample_get_revision():
async def sample_get_revision():
# Create a client
client = run_v2.RevisionsClient()
client = run_v2.RevisionsAsyncClient()
# Initialize request argument(s)
request = run_v2.GetRevisionRequest(
name="name_value",
)
# Make the request
response = client.get_revision(request=request)
response = await client.get_revision(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -329,9 +329,9 @@ async def list_revisions(
from google.cloud import run_v2
def sample_list_revisions():
async def sample_list_revisions():
# Create a client
client = run_v2.RevisionsClient()
client = run_v2.RevisionsAsyncClient()
# Initialize request argument(s)
request = run_v2.ListRevisionsRequest(
Expand All @@ -342,7 +342,7 @@ def sample_list_revisions():
page_result = client.list_revisions(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -440,9 +440,9 @@ async def delete_revision(
from google.cloud import run_v2
def sample_delete_revision():
async def sample_delete_revision():
# Create a client
client = run_v2.RevisionsClient()
client = run_v2.RevisionsAsyncClient()
# Initialize request argument(s)
request = run_v2.DeleteRevisionRequest(
Expand All @@ -454,7 +454,7 @@ def sample_delete_revision():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ async def create_service(
from google.cloud import run_v2
def sample_create_service():
async def sample_create_service():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = run_v2.CreateServiceRequest(
Expand All @@ -249,7 +249,7 @@ def sample_create_service():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -370,17 +370,17 @@ async def get_service(
from google.cloud import run_v2
def sample_get_service():
async def sample_get_service():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = run_v2.GetServiceRequest(
name="name_value",
)
# Make the request
response = client.get_service(request=request)
response = await client.get_service(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -482,9 +482,9 @@ async def list_services(
from google.cloud import run_v2
def sample_list_services():
async def sample_list_services():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = run_v2.ListServicesRequest(
Expand All @@ -495,7 +495,7 @@ def sample_list_services():
page_result = client.list_services(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -603,9 +603,9 @@ async def update_service(
from google.cloud import run_v2
def sample_update_service():
async def sample_update_service():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = run_v2.UpdateServiceRequest(
Expand All @@ -616,7 +616,7 @@ def sample_update_service():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -725,9 +725,9 @@ async def delete_service(
from google.cloud import run_v2
def sample_delete_service():
async def sample_delete_service():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = run_v2.DeleteServiceRequest(
Expand All @@ -739,7 +739,7 @@ def sample_delete_service():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -842,17 +842,17 @@ async def get_iam_policy(
from google.cloud import run_v2
from google.iam.v1 import iam_policy_pb2 # type: ignore
def sample_get_iam_policy():
async def sample_get_iam_policy():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = iam_policy_pb2.GetIamPolicyRequest(
resource="resource_value",
)
# Make the request
response = client.get_iam_policy(request=request)
response = await client.get_iam_policy(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -979,17 +979,17 @@ async def set_iam_policy(
from google.cloud import run_v2
from google.iam.v1 import iam_policy_pb2 # type: ignore
def sample_set_iam_policy():
async def sample_set_iam_policy():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = iam_policy_pb2.SetIamPolicyRequest(
resource="resource_value",
)
# Make the request
response = client.set_iam_policy(request=request)
response = await client.set_iam_policy(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -1118,9 +1118,9 @@ async def test_iam_permissions(
from google.cloud import run_v2
from google.iam.v1 import iam_policy_pb2 # type: ignore
def sample_test_iam_permissions():
async def sample_test_iam_permissions():
# Create a client
client = run_v2.ServicesClient()
client = run_v2.ServicesAsyncClient()
# Initialize request argument(s)
request = iam_policy_pb2.TestIamPermissionsRequest(
Expand All @@ -1129,7 +1129,7 @@ def sample_test_iam_permissions():
)
# Make the request
response = client.test_iam_permissions(request=request)
response = await client.test_iam_permissions(request=request)
# Handle the response
print(response)
Expand Down
26 changes: 13 additions & 13 deletions packages/google-cloud-run/tests/unit/gapic/run_v2/test_revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def test_get_revision_field_headers():
# a field header. Set these to a non-empty value.
request = revision.GetRevisionRequest()

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_revision), "__call__") as call:
Expand All @@ -801,7 +801,7 @@ def test_get_revision_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand All @@ -815,7 +815,7 @@ async def test_get_revision_field_headers_async():
# a field header. Set these to a non-empty value.
request = revision.GetRevisionRequest()

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_revision), "__call__") as call:
Expand All @@ -831,7 +831,7 @@ async def test_get_revision_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 @@ -1013,7 +1013,7 @@ def test_list_revisions_field_headers():
# a field header. Set these to a non-empty value.
request = revision.ListRevisionsRequest()

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_revisions), "__call__") as call:
Expand All @@ -1029,7 +1029,7 @@ def test_list_revisions_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"parent=parent/value",
"parent=parent_value",
) in kw["metadata"]


Expand All @@ -1043,7 +1043,7 @@ async def test_list_revisions_field_headers_async():
# a field header. Set these to a non-empty value.
request = revision.ListRevisionsRequest()

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_revisions), "__call__") as call:
Expand All @@ -1061,7 +1061,7 @@ async def test_list_revisions_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"parent=parent/value",
"parent=parent_value",
) in kw["metadata"]


Expand Down Expand Up @@ -1192,7 +1192,7 @@ def test_list_revisions_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, revision.Revision) for i in results)

Expand Down Expand Up @@ -1427,7 +1427,7 @@ def test_delete_revision_field_headers():
# a field header. Set these to a non-empty value.
request = revision.DeleteRevisionRequest()

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_revision), "__call__") as call:
Expand All @@ -1443,7 +1443,7 @@ def test_delete_revision_field_headers():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand All @@ -1457,7 +1457,7 @@ async def test_delete_revision_field_headers_async():
# a field header. Set these to a non-empty value.
request = revision.DeleteRevisionRequest()

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_revision), "__call__") as call:
Expand All @@ -1475,7 +1475,7 @@ async def test_delete_revision_field_headers_async():
_, _, kw = call.mock_calls[0]
assert (
"x-goog-request-params",
"name=name/value",
"name=name_value",
) in kw["metadata"]


Expand Down
Loading

0 comments on commit 1feed4f

Please sign in to comment.