Skip to content

Commit d96f878

Browse files
chore: use gapic-generator-python 0.65.2 (#46)
* 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>
1 parent 33c9a2b commit d96f878

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

packages/google-cloud-ids/google/cloud/ids_v1/services/ids/async_client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ async def list_endpoints(
213213
214214
from google.cloud import ids_v1
215215
216-
def sample_list_endpoints():
216+
async def sample_list_endpoints():
217217
# Create a client
218-
client = ids_v1.IDSClient()
218+
client = ids_v1.IDSAsyncClient()
219219
220220
# Initialize request argument(s)
221221
request = ids_v1.ListEndpointsRequest(
@@ -226,7 +226,7 @@ def sample_list_endpoints():
226226
page_result = client.list_endpoints(request=request)
227227
228228
# Handle the response
229-
for response in page_result:
229+
async for response in page_result:
230230
print(response)
231231
232232
Args:
@@ -327,17 +327,17 @@ async def get_endpoint(
327327
328328
from google.cloud import ids_v1
329329
330-
def sample_get_endpoint():
330+
async def sample_get_endpoint():
331331
# Create a client
332-
client = ids_v1.IDSClient()
332+
client = ids_v1.IDSAsyncClient()
333333
334334
# Initialize request argument(s)
335335
request = ids_v1.GetEndpointRequest(
336336
name="name_value",
337337
)
338338
339339
# Make the request
340-
response = client.get_endpoint(request=request)
340+
response = await client.get_endpoint(request=request)
341341
342342
# Handle the response
343343
print(response)
@@ -435,9 +435,9 @@ async def create_endpoint(
435435
436436
from google.cloud import ids_v1
437437
438-
def sample_create_endpoint():
438+
async def sample_create_endpoint():
439439
# Create a client
440-
client = ids_v1.IDSClient()
440+
client = ids_v1.IDSAsyncClient()
441441
442442
# Initialize request argument(s)
443443
endpoint = ids_v1.Endpoint()
@@ -455,7 +455,7 @@ def sample_create_endpoint():
455455
456456
print("Waiting for operation to complete...")
457457
458-
response = operation.result()
458+
response = await operation.result()
459459
460460
# Handle the response
461461
print(response)
@@ -567,9 +567,9 @@ async def delete_endpoint(
567567
568568
from google.cloud import ids_v1
569569
570-
def sample_delete_endpoint():
570+
async def sample_delete_endpoint():
571571
# Create a client
572-
client = ids_v1.IDSClient()
572+
client = ids_v1.IDSAsyncClient()
573573
574574
# Initialize request argument(s)
575575
request = ids_v1.DeleteEndpointRequest(
@@ -581,7 +581,7 @@ def sample_delete_endpoint():
581581
582582
print("Waiting for operation to complete...")
583583
584-
response = operation.result()
584+
response = await operation.result()
585585
586586
# Handle the response
587587
print(response)

packages/google-cloud-ids/tests/unit/gapic/ids_v1/test_ids.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def test_list_endpoints_field_headers():
693693
# a field header. Set these to a non-empty value.
694694
request = ids.ListEndpointsRequest()
695695

696-
request.parent = "parent/value"
696+
request.parent = "parent_value"
697697

698698
# Mock the actual call within the gRPC stub, and fake the request.
699699
with mock.patch.object(type(client.transport.list_endpoints), "__call__") as call:
@@ -709,7 +709,7 @@ def test_list_endpoints_field_headers():
709709
_, _, kw = call.mock_calls[0]
710710
assert (
711711
"x-goog-request-params",
712-
"parent=parent/value",
712+
"parent=parent_value",
713713
) in kw["metadata"]
714714

715715

@@ -723,7 +723,7 @@ async def test_list_endpoints_field_headers_async():
723723
# a field header. Set these to a non-empty value.
724724
request = ids.ListEndpointsRequest()
725725

726-
request.parent = "parent/value"
726+
request.parent = "parent_value"
727727

728728
# Mock the actual call within the gRPC stub, and fake the request.
729729
with mock.patch.object(type(client.transport.list_endpoints), "__call__") as call:
@@ -741,7 +741,7 @@ async def test_list_endpoints_field_headers_async():
741741
_, _, kw = call.mock_calls[0]
742742
assert (
743743
"x-goog-request-params",
744-
"parent=parent/value",
744+
"parent=parent_value",
745745
) in kw["metadata"]
746746

747747

@@ -872,7 +872,7 @@ def test_list_endpoints_pager(transport_name: str = "grpc"):
872872

873873
assert pager._metadata == metadata
874874

875-
results = [i for i in pager]
875+
results = list(pager)
876876
assert len(results) == 6
877877
assert all(isinstance(i, ids.Endpoint) for i in results)
878878

@@ -1141,7 +1141,7 @@ def test_get_endpoint_field_headers():
11411141
# a field header. Set these to a non-empty value.
11421142
request = ids.GetEndpointRequest()
11431143

1144-
request.name = "name/value"
1144+
request.name = "name_value"
11451145

11461146
# Mock the actual call within the gRPC stub, and fake the request.
11471147
with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call:
@@ -1157,7 +1157,7 @@ def test_get_endpoint_field_headers():
11571157
_, _, kw = call.mock_calls[0]
11581158
assert (
11591159
"x-goog-request-params",
1160-
"name=name/value",
1160+
"name=name_value",
11611161
) in kw["metadata"]
11621162

11631163

@@ -1171,7 +1171,7 @@ async def test_get_endpoint_field_headers_async():
11711171
# a field header. Set these to a non-empty value.
11721172
request = ids.GetEndpointRequest()
11731173

1174-
request.name = "name/value"
1174+
request.name = "name_value"
11751175

11761176
# Mock the actual call within the gRPC stub, and fake the request.
11771177
with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call:
@@ -1187,7 +1187,7 @@ async def test_get_endpoint_field_headers_async():
11871187
_, _, kw = call.mock_calls[0]
11881188
assert (
11891189
"x-goog-request-params",
1190-
"name=name/value",
1190+
"name=name_value",
11911191
) in kw["metadata"]
11921192

11931193

@@ -1363,7 +1363,7 @@ def test_create_endpoint_field_headers():
13631363
# a field header. Set these to a non-empty value.
13641364
request = ids.CreateEndpointRequest()
13651365

1366-
request.parent = "parent/value"
1366+
request.parent = "parent_value"
13671367

13681368
# Mock the actual call within the gRPC stub, and fake the request.
13691369
with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call:
@@ -1379,7 +1379,7 @@ def test_create_endpoint_field_headers():
13791379
_, _, kw = call.mock_calls[0]
13801380
assert (
13811381
"x-goog-request-params",
1382-
"parent=parent/value",
1382+
"parent=parent_value",
13831383
) in kw["metadata"]
13841384

13851385

@@ -1393,7 +1393,7 @@ async def test_create_endpoint_field_headers_async():
13931393
# a field header. Set these to a non-empty value.
13941394
request = ids.CreateEndpointRequest()
13951395

1396-
request.parent = "parent/value"
1396+
request.parent = "parent_value"
13971397

13981398
# Mock the actual call within the gRPC stub, and fake the request.
13991399
with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call:
@@ -1411,7 +1411,7 @@ async def test_create_endpoint_field_headers_async():
14111411
_, _, kw = call.mock_calls[0]
14121412
assert (
14131413
"x-goog-request-params",
1414-
"parent=parent/value",
1414+
"parent=parent_value",
14151415
) in kw["metadata"]
14161416

14171417

@@ -1609,7 +1609,7 @@ def test_delete_endpoint_field_headers():
16091609
# a field header. Set these to a non-empty value.
16101610
request = ids.DeleteEndpointRequest()
16111611

1612-
request.name = "name/value"
1612+
request.name = "name_value"
16131613

16141614
# Mock the actual call within the gRPC stub, and fake the request.
16151615
with mock.patch.object(type(client.transport.delete_endpoint), "__call__") as call:
@@ -1625,7 +1625,7 @@ def test_delete_endpoint_field_headers():
16251625
_, _, kw = call.mock_calls[0]
16261626
assert (
16271627
"x-goog-request-params",
1628-
"name=name/value",
1628+
"name=name_value",
16291629
) in kw["metadata"]
16301630

16311631

@@ -1639,7 +1639,7 @@ async def test_delete_endpoint_field_headers_async():
16391639
# a field header. Set these to a non-empty value.
16401640
request = ids.DeleteEndpointRequest()
16411641

1642-
request.name = "name/value"
1642+
request.name = "name_value"
16431643

16441644
# Mock the actual call within the gRPC stub, and fake the request.
16451645
with mock.patch.object(type(client.transport.delete_endpoint), "__call__") as call:
@@ -1657,7 +1657,7 @@ async def test_delete_endpoint_field_headers_async():
16571657
_, _, kw = call.mock_calls[0]
16581658
assert (
16591659
"x-goog-request-params",
1660-
"name=name/value",
1660+
"name=name_value",
16611661
) in kw["metadata"]
16621662

16631663

0 commit comments

Comments
 (0)