Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit fced217

Browse files
chore: use gapic-generator-python 0.65.2 (#14)
* chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: googleapis/googleapis@f91b6cf 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 82adb11 commit fced217

File tree

4 files changed

+79
-79
lines changed

4 files changed

+79
-79
lines changed

google/cloud/run_v2/services/revisions/async_client.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,17 @@ async def get_revision(
229229
230230
from google.cloud import run_v2
231231
232-
def sample_get_revision():
232+
async def sample_get_revision():
233233
# Create a client
234-
client = run_v2.RevisionsClient()
234+
client = run_v2.RevisionsAsyncClient()
235235
236236
# Initialize request argument(s)
237237
request = run_v2.GetRevisionRequest(
238238
name="name_value",
239239
)
240240
241241
# Make the request
242-
response = client.get_revision(request=request)
242+
response = await client.get_revision(request=request)
243243
244244
# Handle the response
245245
print(response)
@@ -329,9 +329,9 @@ async def list_revisions(
329329
330330
from google.cloud import run_v2
331331
332-
def sample_list_revisions():
332+
async def sample_list_revisions():
333333
# Create a client
334-
client = run_v2.RevisionsClient()
334+
client = run_v2.RevisionsAsyncClient()
335335
336336
# Initialize request argument(s)
337337
request = run_v2.ListRevisionsRequest(
@@ -342,7 +342,7 @@ def sample_list_revisions():
342342
page_result = client.list_revisions(request=request)
343343
344344
# Handle the response
345-
for response in page_result:
345+
async for response in page_result:
346346
print(response)
347347
348348
Args:
@@ -440,9 +440,9 @@ async def delete_revision(
440440
441441
from google.cloud import run_v2
442442
443-
def sample_delete_revision():
443+
async def sample_delete_revision():
444444
# Create a client
445-
client = run_v2.RevisionsClient()
445+
client = run_v2.RevisionsAsyncClient()
446446
447447
# Initialize request argument(s)
448448
request = run_v2.DeleteRevisionRequest(
@@ -454,7 +454,7 @@ def sample_delete_revision():
454454
455455
print("Waiting for operation to complete...")
456456
457-
response = operation.result()
457+
response = await operation.result()
458458
459459
# Handle the response
460460
print(response)

google/cloud/run_v2/services/services/async_client.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ async def create_service(
234234
235235
from google.cloud import run_v2
236236
237-
def sample_create_service():
237+
async def sample_create_service():
238238
# Create a client
239-
client = run_v2.ServicesClient()
239+
client = run_v2.ServicesAsyncClient()
240240
241241
# Initialize request argument(s)
242242
request = run_v2.CreateServiceRequest(
@@ -249,7 +249,7 @@ def sample_create_service():
249249
250250
print("Waiting for operation to complete...")
251251
252-
response = operation.result()
252+
response = await operation.result()
253253
254254
# Handle the response
255255
print(response)
@@ -370,17 +370,17 @@ async def get_service(
370370
371371
from google.cloud import run_v2
372372
373-
def sample_get_service():
373+
async def sample_get_service():
374374
# Create a client
375-
client = run_v2.ServicesClient()
375+
client = run_v2.ServicesAsyncClient()
376376
377377
# Initialize request argument(s)
378378
request = run_v2.GetServiceRequest(
379379
name="name_value",
380380
)
381381
382382
# Make the request
383-
response = client.get_service(request=request)
383+
response = await client.get_service(request=request)
384384
385385
# Handle the response
386386
print(response)
@@ -482,9 +482,9 @@ async def list_services(
482482
483483
from google.cloud import run_v2
484484
485-
def sample_list_services():
485+
async def sample_list_services():
486486
# Create a client
487-
client = run_v2.ServicesClient()
487+
client = run_v2.ServicesAsyncClient()
488488
489489
# Initialize request argument(s)
490490
request = run_v2.ListServicesRequest(
@@ -495,7 +495,7 @@ def sample_list_services():
495495
page_result = client.list_services(request=request)
496496
497497
# Handle the response
498-
for response in page_result:
498+
async for response in page_result:
499499
print(response)
500500
501501
Args:
@@ -603,9 +603,9 @@ async def update_service(
603603
604604
from google.cloud import run_v2
605605
606-
def sample_update_service():
606+
async def sample_update_service():
607607
# Create a client
608-
client = run_v2.ServicesClient()
608+
client = run_v2.ServicesAsyncClient()
609609
610610
# Initialize request argument(s)
611611
request = run_v2.UpdateServiceRequest(
@@ -616,7 +616,7 @@ def sample_update_service():
616616
617617
print("Waiting for operation to complete...")
618618
619-
response = operation.result()
619+
response = await operation.result()
620620
621621
# Handle the response
622622
print(response)
@@ -725,9 +725,9 @@ async def delete_service(
725725
726726
from google.cloud import run_v2
727727
728-
def sample_delete_service():
728+
async def sample_delete_service():
729729
# Create a client
730-
client = run_v2.ServicesClient()
730+
client = run_v2.ServicesAsyncClient()
731731
732732
# Initialize request argument(s)
733733
request = run_v2.DeleteServiceRequest(
@@ -739,7 +739,7 @@ def sample_delete_service():
739739
740740
print("Waiting for operation to complete...")
741741
742-
response = operation.result()
742+
response = await operation.result()
743743
744744
# Handle the response
745745
print(response)
@@ -842,17 +842,17 @@ async def get_iam_policy(
842842
from google.cloud import run_v2
843843
from google.iam.v1 import iam_policy_pb2 # type: ignore
844844
845-
def sample_get_iam_policy():
845+
async def sample_get_iam_policy():
846846
# Create a client
847-
client = run_v2.ServicesClient()
847+
client = run_v2.ServicesAsyncClient()
848848
849849
# Initialize request argument(s)
850850
request = iam_policy_pb2.GetIamPolicyRequest(
851851
resource="resource_value",
852852
)
853853
854854
# Make the request
855-
response = client.get_iam_policy(request=request)
855+
response = await client.get_iam_policy(request=request)
856856
857857
# Handle the response
858858
print(response)
@@ -979,17 +979,17 @@ async def set_iam_policy(
979979
from google.cloud import run_v2
980980
from google.iam.v1 import iam_policy_pb2 # type: ignore
981981
982-
def sample_set_iam_policy():
982+
async def sample_set_iam_policy():
983983
# Create a client
984-
client = run_v2.ServicesClient()
984+
client = run_v2.ServicesAsyncClient()
985985
986986
# Initialize request argument(s)
987987
request = iam_policy_pb2.SetIamPolicyRequest(
988988
resource="resource_value",
989989
)
990990
991991
# Make the request
992-
response = client.set_iam_policy(request=request)
992+
response = await client.set_iam_policy(request=request)
993993
994994
# Handle the response
995995
print(response)
@@ -1118,9 +1118,9 @@ async def test_iam_permissions(
11181118
from google.cloud import run_v2
11191119
from google.iam.v1 import iam_policy_pb2 # type: ignore
11201120
1121-
def sample_test_iam_permissions():
1121+
async def sample_test_iam_permissions():
11221122
# Create a client
1123-
client = run_v2.ServicesClient()
1123+
client = run_v2.ServicesAsyncClient()
11241124
11251125
# Initialize request argument(s)
11261126
request = iam_policy_pb2.TestIamPermissionsRequest(
@@ -1129,7 +1129,7 @@ def sample_test_iam_permissions():
11291129
)
11301130
11311131
# Make the request
1132-
response = client.test_iam_permissions(request=request)
1132+
response = await client.test_iam_permissions(request=request)
11331133
11341134
# Handle the response
11351135
print(response)

tests/unit/gapic/run_v2/test_revisions.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ def test_get_revision_field_headers():
785785
# a field header. Set these to a non-empty value.
786786
request = revision.GetRevisionRequest()
787787

788-
request.name = "name/value"
788+
request.name = "name_value"
789789

790790
# Mock the actual call within the gRPC stub, and fake the request.
791791
with mock.patch.object(type(client.transport.get_revision), "__call__") as call:
@@ -801,7 +801,7 @@ def test_get_revision_field_headers():
801801
_, _, kw = call.mock_calls[0]
802802
assert (
803803
"x-goog-request-params",
804-
"name=name/value",
804+
"name=name_value",
805805
) in kw["metadata"]
806806

807807

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

818-
request.name = "name/value"
818+
request.name = "name_value"
819819

820820
# Mock the actual call within the gRPC stub, and fake the request.
821821
with mock.patch.object(type(client.transport.get_revision), "__call__") as call:
@@ -831,7 +831,7 @@ async def test_get_revision_field_headers_async():
831831
_, _, kw = call.mock_calls[0]
832832
assert (
833833
"x-goog-request-params",
834-
"name=name/value",
834+
"name=name_value",
835835
) in kw["metadata"]
836836

837837

@@ -1013,7 +1013,7 @@ def test_list_revisions_field_headers():
10131013
# a field header. Set these to a non-empty value.
10141014
request = revision.ListRevisionsRequest()
10151015

1016-
request.parent = "parent/value"
1016+
request.parent = "parent_value"
10171017

10181018
# Mock the actual call within the gRPC stub, and fake the request.
10191019
with mock.patch.object(type(client.transport.list_revisions), "__call__") as call:
@@ -1029,7 +1029,7 @@ def test_list_revisions_field_headers():
10291029
_, _, kw = call.mock_calls[0]
10301030
assert (
10311031
"x-goog-request-params",
1032-
"parent=parent/value",
1032+
"parent=parent_value",
10331033
) in kw["metadata"]
10341034

10351035

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

1046-
request.parent = "parent/value"
1046+
request.parent = "parent_value"
10471047

10481048
# Mock the actual call within the gRPC stub, and fake the request.
10491049
with mock.patch.object(type(client.transport.list_revisions), "__call__") as call:
@@ -1061,7 +1061,7 @@ async def test_list_revisions_field_headers_async():
10611061
_, _, kw = call.mock_calls[0]
10621062
assert (
10631063
"x-goog-request-params",
1064-
"parent=parent/value",
1064+
"parent=parent_value",
10651065
) in kw["metadata"]
10661066

10671067

@@ -1192,7 +1192,7 @@ def test_list_revisions_pager(transport_name: str = "grpc"):
11921192

11931193
assert pager._metadata == metadata
11941194

1195-
results = [i for i in pager]
1195+
results = list(pager)
11961196
assert len(results) == 6
11971197
assert all(isinstance(i, revision.Revision) for i in results)
11981198

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

1430-
request.name = "name/value"
1430+
request.name = "name_value"
14311431

14321432
# Mock the actual call within the gRPC stub, and fake the request.
14331433
with mock.patch.object(type(client.transport.delete_revision), "__call__") as call:
@@ -1443,7 +1443,7 @@ def test_delete_revision_field_headers():
14431443
_, _, kw = call.mock_calls[0]
14441444
assert (
14451445
"x-goog-request-params",
1446-
"name=name/value",
1446+
"name=name_value",
14471447
) in kw["metadata"]
14481448

14491449

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

1460-
request.name = "name/value"
1460+
request.name = "name_value"
14611461

14621462
# Mock the actual call within the gRPC stub, and fake the request.
14631463
with mock.patch.object(type(client.transport.delete_revision), "__call__") as call:
@@ -1475,7 +1475,7 @@ async def test_delete_revision_field_headers_async():
14751475
_, _, kw = call.mock_calls[0]
14761476
assert (
14771477
"x-goog-request-params",
1478-
"name=name/value",
1478+
"name=name_value",
14791479
) in kw["metadata"]
14801480

14811481

0 commit comments

Comments
 (0)