8000 chore: use gapic-generator-python 0.65.2 (#183) · googleapis/google-cloud-python@d0f6c91 · GitHub
[go: up one dir, main page]

Skip to content

Commit d0f6c91

Browse files
chore: use gapic-generator-python 0.65.2 (#183)
* 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 fe6d8fc commit d0f6c91

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/services/dashboards_service/async_client.py

Lines changed: 15 additions & 15 deletions
486
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ async def create_dashboard(
231231
232232
from google.monitoring import dashboard_v1
233233
234-
def sample_create_dashboard():
234+
async def sample_create_dashboard():
235235
# Create a client
236-
client = dashboard_v1.DashboardsServiceClient()
236+
client = dashboard_v1.DashboardsServiceAsyncClient()
237237
238238
# Initialize request argument(s)
239239
dashboard = dashboard_v1.Dashboard()
@@ -245,7 +245,7 @@ def sample_create_dashboard():
245245
)
246246
247247
# Make the request
248-
response = client.create_dashboard(request=request)
248+
response = await client.create_dashboard(request=request)
249249
250250
# Handle the response
251251
print(response)
@@ -314,9 +314,9 @@ async def list_dashboards(
314314
315315
from google.monitoring import dashboard_v1
316316
317-
def sample_list_dashboards():
317+
async def sample_list_dashboards():
318318
# Create a client
319-
client = dashboard_v1.DashboardsServiceClient()
319+
client = dashboard_v1.DashboardsServiceAsyncClient()
320320
321321
# Initialize request argument(s)
322322
request = dashboard_v1.ListDashboardsRequest(
@@ -327,7 +327,7 @@ def sample_list_dashboards():
327327
page_result = client.list_dashboards(request=request)
328328
329329
# Handle the response
330-
for response in page_result:
330+
async for response in page_result:
331331
print(response)
332332
333333
Args:
@@ -403,17 +403,17 @@ async def get_dashboard(
403403
404404
from google.monitoring import dashboard_v1
405405
406-
def sample_get_dashboard():
406+
async def sample_get_dashboard():
407407
# Create a client
408-
client = dashboard_v1.DashboardsServiceClient()
408+
client = dashboard_v1.DashboardsServiceAsyncClient()
409409
410410
# Initialize request argument(s)
411411
request = dashboard_v1.GetDashboardRequest(
412412
name="name_value",
413413
)
414414
415415
# Make the request
416-
response = client.get_dashboard(request=request)
416+
response = await client.get_dashboard(request=request)
417417
418418
# Handle the response
419419
print(response)
@@ -482,17 +482,17 @@ async def delete_dashboard(
482482
483483
from google.monitoring import dashboard_v1
484484
485-
def sample_delete_dashboard():
485+
async def sample_delete_dashboard():
486
# Create a client
487-
client = dashboard_v1.DashboardsServiceClient()
487+
client = dashboard_v1.DashboardsServiceAsyncClient()
488488
489489
# Initialize request argument(s)
490490
request = dashboard_v1.DeleteDashboardRequest(
491491
name="name_value",
492492
)
493493
494494
# Make the request
495-
client.delete_dashboard(request=request)
495+
await client.delete_dashboard(request=request)
496496
497497
Args:
498498
request (Union[google.cloud.monitoring_dashboard_v1.types.DeleteDashboardRequest, dict]):
@@ -547,9 +547,9 @@ async def update_dashboard(
547547
548548
from google.monitoring import dashboard_v1
549549
550-
def sample_update_dashboard():
550+
async def sample_update_dashboard():
551551
# Create a client
552-
client = dashboard_v1.DashboardsServiceClient()
552+
client = dashboard_v1.DashboardsServiceAsyncClient()
553553
554554
# Initialize request argument(s)
555555
dashboard = dashboard_v1.Dashboard()
@@ -560,7 +560,7 @@ def sample_update_dashboard():
560560
)
561561
562562
# Make the request
563-
response = client.update_dashboard(request=request)
563+
response = await client.update_dashboard(request=request)
564564
565565
# Handle the response
566566
print(response)

packages/google-cloud-monitoring-dashboards/tests/unit/gapic/dashboard_v1/test_dashboards_service.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def test_create_dashboard_field_headers():
792792
# a field header. Set these to a non-empty value.
793793
request = dashboards_service.CreateDashboardRequest()
794794

795-
request.parent = "parent/value"
795+
request.parent = "parent_value"
796796

797797
# Mock the actual call within the gRPC stub, and fake the request.
798798
with mock.patch.object(type(client.transport.create_dashboard), "__call__") as call:
@@ -808,7 +808,7 @@ def test_create_dashboard_field_headers():
808808
_, _, kw = call.mock_calls[0]
809809
assert (
810810
"x-goog-request-params",
811-
"parent=parent/value",
811+
"parent=parent_value",
812812
) in kw["metadata"]
813813

814814

@@ -822,7 +822,7 @@ async def test_create_dashboard_field_headers_async():
822822
# a field header. Set these to a non-empty value.
823823
request = dashboards_service.CreateDashboardRequest()
824824

825-
request.parent = "parent/value"
825+
request.parent = "parent_value"
826826

827827
# Mock the actual call within the gRPC stub, and fake the request.
828828
with mock.patch.object(type(client.transport.create_dashboard), "__call__") as call:
@@ -838,7 +838,7 @@ async def test_create_dashboard_field_headers_async():
838838
_, _, kw = call.mock_calls[0]
839839
assert (
840840
"x-goog-request-params",
841-
"parent=parent/value",
841+
"parent=parent_value",
842842
) in kw["metadata"]
843843

844844

@@ -941,7 +941,7 @@ def test_list_dashboards_field_headers():
941941
# a field header. Set these to a non-empty value.
942942
request = dashboards_service.ListDashboardsRequest()
943943

944-
request.parent = "parent/value"
944+
request.parent = "parent_value"
945945

946946
# Mock the actual call within the gRPC stub, and fake the request.
947947
with mock.patch.object(type(client.transport.list_dashboards), "__call__") as call:
@@ -957,7 +957,7 @@ def test_list_dashboards_field_headers():
957957
_, _, kw = call.mock_calls[0]
958958
assert (
959959
"x-goog-request-params",
960-
"parent=parent/value",
960+
"parent=parent_value",
961961
) in kw["metadata"]
962962

963963

@@ -971,7 +971,7 @@ async def test_list_dashboards_field_headers_async():
971971
# a field header. Set these to a non-empty value.
972972
request = dashboards_service.ListDashboardsRequest()
973973

974-
request.parent = "parent/value"
974+
request.parent = "parent_value"
975975

976976
# Mock the actual call within the gRPC stub, and fake the request.
977977
with mock.patch.object(type(client.transport.list_dashboards), "__call__") as call:
@@ -989,7 +989,7 @@ async def test_list_dashboards_field_headers_async():
989989
_, _, kw = call.mock_calls[0]
990990
assert (
991991
"x-goog-request-params",
992-
"parent=parent/value",
992+
"parent=parent_value",
993993
) in kw["metadata"]
994994

995995

@@ -1038,7 +1038,7 @@ def test_list_dashboards_pager(transport_name: str = "grpc"):
10381038

10391039
assert pager._metadata == metadata
10401040

1041-
results = [i for i in pager]
1041+
results = list(pager)
10421042
assert len(results) == 6
10431043
assert all(isinstance(i, dashboard.Dashboard) for i in results)
10441044

@@ -1288,7 +1288,7 @@ def test_get_dashboard_field_headers():
12881288
# a field header. Set these to a non-empty value.
12891289
request = dashboards_service.GetDashboardRequest()
12901290

1291-
request.name = "name/value"
1291+
request.name = "name_value"
12921292

12931293
# Mock the actual call within the gRPC stub, and fake the request.
12941294
with mock.patch.object(type(client.transport.get_dashboard), "__call__") as call:
@@ -1304,7 +1304,7 @@ def test_get_dashboard_field_headers():
13041304
_, _, kw = call.mock_calls[0]
13051305
assert (
13061306
"x-goog-request-params",
1307-
"name=name/value",
1307+
"name=name_value",
13081308
) in kw["metadata"]
13091309

13101310

@@ -1318,7 +1318,7 @@ async def test_get_dashboard_field_headers_async():
13181318
# a field header. Set these to a non-empty value.
13191319
request = dashboards_service.GetDashboardRequest()
13201320

1321-
request.name = "name/value"
1321+
request.name = "name_value"
13221322

13231323
# Mock the actual call within the gRPC stub, and fake the request.
13241324
with mock.patch.object(type(client.transport.get_dashboard), "__call__") as call:
@@ -1334,7 +1334,7 @@ async def test_get_dashboard_field_headers_async():
13341334
_, _, kw = call.mock_calls[0]
13351335
assert (
13361336
"x-goog-request-params",
1337-
"name=name/value",
1337+
"name=name_value",
13381338
) in kw["metadata"]
13391339

13401340

@@ -1429,7 +1429,7 @@ def test_delete_dashboard_field_headers():
14291429
# a field header. Set these to a non-empty value.
14301430
request = dashboards_service.DeleteDashboardRequest()
14311431

1432-
request.name = "name/value"
1432+
request.name = "name_value"
14331433

14341434
# Mock the actual call within the gRPC stub, and fake the request.
14351435
with mock.patch.object(type(client.transport.delete_dashboard), "__call__") as call:
@@ -1445,7 +1445,7 @@ def test_delete_dashboard_field_headers():
14451445
_, _, kw = call.mock_calls[0]
14461446
assert (
14471447
"x-goog-request-params",
1448-
"name=name/value",
1448+
"name=name_value",
14491449
) in kw["metadata"]
14501450

14511451

@@ -1459,7 +1459,7 @@ async def test_delete_dashboard_field_headers_async():
14591459
# a field header. Set these to a non-empty value.
14601460
request = dashboards_service.DeleteDashboardRequest()
14611461

1462-
request.name = "name/value"
1462+
request.name = "name_value"
14631463

14641464
# Mock the actual call within the gRPC stub, and fake the request.
14651465
with mock.patch.object(type(client.transport.delete_dashboard), "__call__") as call:
@@ -1475,7 +1475,7 @@ async def test_delete_dashboard_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

@@ -1587,7 +1587,7 @@ def test_update_dashboard_field_headers():
15871587
# a field header. Set these to a non-empty value.
15881588
request = dashboards_service.UpdateDashboardRequest()
15891589

1590-
request.dashboard.name = "dashboard.name/value"
1590+
request.dashboard.name = "name_value"
15911591

15921592
# Mock the actual call within the gRPC stub, and fake the request.
15931593
with mock.patch.object(type(client.transport.update_dashboard), "__call__") as call:
@@ -1603,7 +1603,7 @@ def test_update_dashboard_field_headers():
16031603
_, _, kw = call.mock_calls[0]
16041604
assert (
16051605
"x-goog-request-params",
1606-
"dashboard.name=dashboard.name/value",
1606+
"dashboard.name=name_value",
16071607
) in kw["metadata"]
16081608

16091609

@@ -1617,7 +1617,7 @@ async def test_update_dashboard_field_headers_async():
16171617
# a field header. Set these to a non-empty value.
16181618
request = dashboards_service.UpdateDashboardRequest()
16191619

1620-
request.dashboard.name = "dashboard.name/value"
1620+
request.dashboard.name = "name_value"
16211621

16221622
# Mock the actual call within the gRPC stub, and fake the request.
16231623
with mock.patch.object(type(client.transport.update_dashboard), "__call__") as call:
@@ -1633,7 +1633,7 @@ async def test_update_dashboard_field_headers_async():
16331633
_, _, kw = call.mock_calls[0]
16341634
assert (
16351635
"x-goog-request-params",
1636-
"dashboard.name=dashboard.name/value",
1636+
"dashboard.name=name_value",
16371637
) in kw["metadata"]
16381638

16391639

0 commit comments

Comments
 (0)
0