diff --git a/packages/google-cloud-tasks/google/cloud/tasks_v2/services/cloud_tasks/async_client.py b/packages/google-cloud-tasks/google/cloud/tasks_v2/services/cloud_tasks/async_client.py index 4241d209f787..fe092df286a2 100644 --- a/packages/google-cloud-tasks/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/packages/google-cloud-tasks/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -228,9 +228,9 @@ async def list_queues( from google.cloud import tasks_v2 - def sample_list_queues(): + async def sample_list_queues(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.ListQueuesRequest( @@ -241,7 +241,7 @@ def sample_list_queues(): page_result = client.list_queues(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -346,9 +346,9 @@ async def get_queue( from google.cloud import tasks_v2 - def sample_get_queue(): + async def sample_get_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.GetQueueRequest( @@ -356,7 +356,7 @@ def sample_get_queue(): ) # Make the request - response = client.get_queue(request=request) + response = await client.get_queue(request=request) # Handle the response print(response) @@ -466,9 +466,9 @@ async def create_queue( from google.cloud import tasks_v2 - def sample_create_queue(): + async def sample_create_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.CreateQueueRequest( @@ -476,7 +476,7 @@ def sample_create_queue(): ) # Make the request - response = client.create_queue(request=request) + response = await client.create_queue(request=request) # Handle the response print(response) @@ -595,16 +595,16 @@ async def update_queue( from google.cloud import tasks_v2 - def sample_update_queue(): + async def sample_update_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.UpdateQueueRequest( ) # Make the request - response = client.update_queue(request=request) + response = await client.update_queue(request=request) # Handle the response print(response) @@ -725,9 +725,9 @@ async def delete_queue( from google.cloud import tasks_v2 - def sample_delete_queue(): + async def sample_delete_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.DeleteQueueRequest( @@ -735,7 +735,7 @@ def sample_delete_queue(): ) # Make the request - client.delete_queue(request=request) + await client.delete_queue(request=request) Args: request (Union[google.cloud.tasks_v2.types.DeleteQueueRequest, dict]): @@ -823,9 +823,9 @@ async def purge_queue( from google.cloud import tasks_v2 - def sample_purge_queue(): + async def sample_purge_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.PurgeQueueRequest( @@ -833,7 +833,7 @@ def sample_purge_queue(): ) # Make the request - response = client.purge_queue(request=request) + response = await client.purge_queue(request=request) # Handle the response print(response) @@ -929,9 +929,9 @@ async def pause_queue( from google.cloud import tasks_v2 - def sample_pause_queue(): + async def sample_pause_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.PauseQueueRequest( @@ -939,7 +939,7 @@ def sample_pause_queue(): ) # Make the request - response = client.pause_queue(request=request) + response = await client.pause_queue(request=request) # Handle the response print(response) @@ -1042,9 +1042,9 @@ async def resume_queue( from google.cloud import tasks_v2 - def sample_resume_queue(): + async def sample_resume_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.ResumeQueueRequest( @@ -1052,7 +1052,7 @@ def sample_resume_queue(): ) # Make the request - response = client.resume_queue(request=request) + response = await client.resume_queue(request=request) # Handle the response print(response) @@ -1150,9 +1150,9 @@ async def get_iam_policy( from google.cloud import tasks_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 = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1160,7 +1160,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1331,9 +1331,9 @@ async def set_iam_policy( from google.cloud import tasks_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 = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1341,7 +1341,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1499,9 +1499,9 @@ async def test_iam_permissions( from google.cloud import tasks_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 = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1510,7 +1510,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) @@ -1626,9 +1626,9 @@ async def list_tasks( from google.cloud import tasks_v2 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.ListTasksRequest( @@ -1639,7 +1639,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1745,9 +1745,9 @@ async def get_task( from google.cloud import tasks_v2 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.GetTaskRequest( @@ -1755,7 +1755,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -1855,9 +1855,9 @@ async def create_task( from google.cloud import tasks_v2 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.CreateTaskRequest( @@ -1865,7 +1865,7 @@ def sample_create_task(): ) # Make the request - response = client.create_task(request=request) + response = await client.create_task(request=request) # Handle the response print(response) @@ -2001,9 +2001,9 @@ async def delete_task( from google.cloud import tasks_v2 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.DeleteTaskRequest( @@ -2011,7 +2011,7 @@ def sample_delete_task(): ) # Make the request - client.delete_task(request=request) + await client.delete_task(request=request) Args: request (Union[google.cloud.tasks_v2.types.DeleteTaskRequest, dict]): @@ -2121,9 +2121,9 @@ async def run_task( from google.cloud import tasks_v2 - def sample_run_task(): + async def sample_run_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.RunTaskRequest( @@ -2131,7 +2131,7 @@ def sample_run_task(): ) # Make the request - response = client.run_task(request=request) + response = await client.run_task(request=request) # Handle the response print(response) diff --git a/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py b/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py index 4affe76f6beb..a5bf65715775 100644 --- a/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/packages/google-cloud-tasks/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -228,9 +228,9 @@ async def list_queues( from google.cloud import tasks_v2beta2 - def sample_list_queues(): + async def sample_list_queues(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.ListQueuesRequest( @@ -241,7 +241,7 @@ def sample_list_queues(): page_result = client.list_queues(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -346,9 +346,9 @@ async def get_queue( from google.cloud import tasks_v2beta2 - def sample_get_queue(): + async def sample_get_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.GetQueueRequest( @@ -356,7 +356,7 @@ def sample_get_queue(): ) # Make the request - response = client.get_queue(request=request) + response = await client.get_queue(request=request) # Handle the response print(response) @@ -466,9 +466,9 @@ async def create_queue( from google.cloud import tasks_v2beta2 - def sample_create_queue(): + async def sample_create_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.CreateQueueRequest( @@ -476,7 +476,7 @@ def sample_create_queue(): ) # Make the request - response = client.create_queue(request=request) + response = await client.create_queue(request=request) # Handle the response print(response) @@ -595,16 +595,16 @@ async def update_queue( from google.cloud import tasks_v2beta2 - def sample_update_queue(): + async def sample_update_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.UpdateQueueRequest( ) # Make the request - response = client.update_queue(request=request) + response = await client.update_queue(request=request) # Handle the response print(response) @@ -726,9 +726,9 @@ async def delete_queue( from google.cloud import tasks_v2beta2 - def sample_delete_queue(): + async def sample_delete_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.DeleteQueueRequest( @@ -736,7 +736,7 @@ def sample_delete_queue(): ) # Make the request - client.delete_queue(request=request) + await client.delete_queue(request=request) Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteQueueRequest, dict]): @@ -824,9 +824,9 @@ async def purge_queue( from google.cloud import tasks_v2beta2 - def sample_purge_queue(): + async def sample_purge_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.PurgeQueueRequest( @@ -834,7 +834,7 @@ def sample_purge_queue(): ) # Make the request - response = client.purge_queue(request=request) + response = await client.purge_queue(request=request) # Handle the response print(response) @@ -930,9 +930,9 @@ async def pause_queue( from google.cloud import tasks_v2beta2 - def sample_pause_queue(): + async def sample_pause_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.PauseQueueRequest( @@ -940,7 +940,7 @@ def sample_pause_queue(): ) # Make the request - response = client.pause_queue(request=request) + response = await client.pause_queue(request=request) # Handle the response print(response) @@ -1043,9 +1043,9 @@ async def resume_queue( from google.cloud import tasks_v2beta2 - def sample_resume_queue(): + async def sample_resume_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.ResumeQueueRequest( @@ -1053,7 +1053,7 @@ def sample_resume_queue(): ) # Make the request - response = client.resume_queue(request=request) + response = await client.resume_queue(request=request) # Handle the response print(response) @@ -1151,9 +1151,9 @@ async def get_iam_policy( from google.cloud import tasks_v2beta2 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 = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1161,7 +1161,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1332,9 +1332,9 @@ async def set_iam_policy( from google.cloud import tasks_v2beta2 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 = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1342,7 +1342,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1500,9 +1500,9 @@ async def test_iam_permissions( from google.cloud import tasks_v2beta2 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 = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1511,7 +1511,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) @@ -1627,9 +1627,9 @@ async def list_tasks( from google.cloud import tasks_v2beta2 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.ListTasksRequest( @@ -1640,7 +1640,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1746,9 +1746,9 @@ async def get_task( from google.cloud import tasks_v2beta2 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.GetTaskRequest( @@ -1756,7 +1756,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -1860,9 +1860,9 @@ async def create_task( from google.cloud import tasks_v2beta2 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.CreateTaskRequest( @@ -1870,7 +1870,7 @@ def sample_create_task(): ) # Make the request - response = client.create_task(request=request) + response = await client.create_task(request=request) # Handle the response print(response) @@ -2006,9 +2006,9 @@ async def delete_task( from google.cloud import tasks_v2beta2 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.DeleteTaskRequest( @@ -2016,7 +2016,7 @@ def sample_delete_task(): ) # Make the request - client.delete_task(request=request) + await client.delete_task(request=request) Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteTaskRequest, dict]): @@ -2124,9 +2124,9 @@ async def lease_tasks( from google.cloud import tasks_v2beta2 - def sample_lease_tasks(): + async def sample_lease_tasks(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.LeaseTasksRequest( @@ -2134,7 +2134,7 @@ def sample_lease_tasks(): ) # Make the request - response = client.lease_tasks(request=request) + response = await client.lease_tasks(request=request) # Handle the response print(response) @@ -2267,9 +2267,9 @@ async def acknowledge_task( from google.cloud import tasks_v2beta2 - def sample_acknowledge_task(): + async def sample_acknowledge_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.AcknowledgeTaskRequest( @@ -2277,7 +2277,7 @@ def sample_acknowledge_task(): ) # Make the request - client.acknowledge_task(request=request) + await client.acknowledge_task(request=request) Args: request (Union[google.cloud.tasks_v2beta2.types.AcknowledgeTaskRequest, dict]): @@ -2374,9 +2374,9 @@ async def renew_lease( from google.cloud import tasks_v2beta2 - def sample_renew_lease(): + async def sample_renew_lease(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.RenewLeaseRequest( @@ -2384,7 +2384,7 @@ def sample_renew_lease(): ) # Make the request - response = client.renew_lease(request=request) + response = await client.renew_lease(request=request) # Handle the response print(response) @@ -2504,9 +2504,9 @@ async def cancel_lease( from google.cloud import tasks_v2beta2 - def sample_cancel_lease(): + async def sample_cancel_lease(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.CancelLeaseRequest( @@ -2514,7 +2514,7 @@ def sample_cancel_lease(): ) # Make the request - response = client.cancel_lease(request=request) + response = await client.cancel_lease(request=request) # Handle the response print(response) @@ -2646,9 +2646,9 @@ async def run_task( from google.cloud import tasks_v2beta2 - def sample_run_task(): + async def sample_run_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.RunTaskRequest( @@ -2656,7 +2656,7 @@ def sample_run_task(): ) # Make the request - response = client.run_task(request=request) + response = await client.run_task(request=request) # Handle the response print(response) diff --git a/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py b/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py index 5c049569feb3..06196ba94e0b 100644 --- a/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/packages/google-cloud-tasks/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -228,9 +228,9 @@ async def list_queues( from google.cloud import tasks_v2beta3 - def sample_list_queues(): + async def sample_list_queues(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.ListQueuesRequest( @@ -241,7 +241,7 @@ def sample_list_queues(): page_result = client.list_queues(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -346,9 +346,9 @@ async def get_queue( from google.cloud import tasks_v2beta3 - def sample_get_queue(): + async def sample_get_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.GetQueueRequest( @@ -356,7 +356,7 @@ def sample_get_queue(): ) # Make the request - response = client.get_queue(request=request) + response = await client.get_queue(request=request) # Handle the response print(response) @@ -466,9 +466,9 @@ async def create_queue( from google.cloud import tasks_v2beta3 - def sample_create_queue(): + async def sample_create_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.CreateQueueRequest( @@ -476,7 +476,7 @@ def sample_create_queue(): ) # Make the request - response = client.create_queue(request=request) + response = await client.create_queue(request=request) # Handle the response print(response) @@ -595,16 +595,16 @@ async def update_queue( from google.cloud import tasks_v2beta3 - def sample_update_queue(): + async def sample_update_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.UpdateQueueRequest( ) # Make the request - response = client.update_queue(request=request) + response = await client.update_queue(request=request) # Handle the response print(response) @@ -726,9 +726,9 @@ async def delete_queue( from google.cloud import tasks_v2beta3 - def sample_delete_queue(): + async def sample_delete_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.DeleteQueueRequest( @@ -736,7 +736,7 @@ def sample_delete_queue(): ) # Make the request - client.delete_queue(request=request) + await client.delete_queue(request=request) Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteQueueRequest, dict]): @@ -824,9 +824,9 @@ async def purge_queue( from google.cloud import tasks_v2beta3 - def sample_purge_queue(): + async def sample_purge_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.PurgeQueueRequest( @@ -834,7 +834,7 @@ def sample_purge_queue(): ) # Make the request - response = client.purge_queue(request=request) + response = await client.purge_queue(request=request) # Handle the response print(response) @@ -930,9 +930,9 @@ async def pause_queue( from google.cloud import tasks_v2beta3 - def sample_pause_queue(): + async def sample_pause_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.PauseQueueRequest( @@ -940,7 +940,7 @@ def sample_pause_queue(): ) # Make the request - response = client.pause_queue(request=request) + response = await client.pause_queue(request=request) # Handle the response print(response) @@ -1043,9 +1043,9 @@ async def resume_queue( from google.cloud import tasks_v2beta3 - def sample_resume_queue(): + async def sample_resume_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.ResumeQueueRequest( @@ -1053,7 +1053,7 @@ def sample_resume_queue(): ) # Make the request - response = client.resume_queue(request=request) + response = await client.resume_queue(request=request) # Handle the response print(response) @@ -1151,9 +1151,9 @@ async def get_iam_policy( from google.cloud import tasks_v2beta3 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 = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1161,7 +1161,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1332,9 +1332,9 @@ async def set_iam_policy( from google.cloud import tasks_v2beta3 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 = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1342,7 +1342,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1500,9 +1500,9 @@ async def test_iam_permissions( from google.cloud import tasks_v2beta3 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 = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1511,7 +1511,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) @@ -1627,9 +1627,9 @@ async def list_tasks( from google.cloud import tasks_v2beta3 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.ListTasksRequest( @@ -1640,7 +1640,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1746,9 +1746,9 @@ async def get_task( from google.cloud import tasks_v2beta3 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.GetTaskRequest( @@ -1756,7 +1756,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -1856,9 +1856,9 @@ async def create_task( from google.cloud import tasks_v2beta3 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.CreateTaskRequest( @@ -1866,7 +1866,7 @@ def sample_create_task(): ) # Make the request - response = client.create_task(request=request) + response = await client.create_task(request=request) # Handle the response print(response) @@ -2002,9 +2002,9 @@ async def delete_task( from google.cloud import tasks_v2beta3 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.DeleteTaskRequest( @@ -2012,7 +2012,7 @@ def sample_delete_task(): ) # Make the request - client.delete_task(request=request) + await client.delete_task(request=request) Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteTaskRequest, dict]): @@ -2123,9 +2123,9 @@ async def run_task( from google.cloud import tasks_v2beta3 - def sample_run_task(): + async def sample_run_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.RunTaskRequest( @@ -2133,7 +2133,7 @@ def sample_run_task(): ) # Make the request - response = client.run_task(request=request) + response = await client.run_task(request=request) # Handle the response print(response) diff --git a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index 423b0529c847..35dda73e98e5 100644 --- a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -732,7 +732,7 @@ def test_list_queues_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - 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_queues), "__call__") as call: @@ -748,7 +748,7 @@ def test_list_queues_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -762,7 +762,7 @@ async def test_list_queues_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - 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_queues), "__call__") as call: @@ -780,7 +780,7 @@ async def test_list_queues_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -911,7 +911,7 @@ def test_list_queues_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, queue.Queue) for i in results) @@ -1156,7 +1156,7 @@ def test_get_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - 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_queue), "__call__") as call: @@ -1172,7 +1172,7 @@ def test_get_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1186,7 +1186,7 @@ async def test_get_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - 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_queue), "__call__") as call: @@ -1202,7 +1202,7 @@ async def test_get_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1388,7 +1388,7 @@ def test_create_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - 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.create_queue), "__call__") as call: @@ -1404,7 +1404,7 @@ def test_create_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1418,7 +1418,7 @@ async def test_create_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - 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.create_queue), "__call__") as call: @@ -1434,7 +1434,7 @@ async def test_create_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1630,7 +1630,7 @@ def test_update_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1646,7 +1646,7 @@ def test_update_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1660,7 +1660,7 @@ async def test_update_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1676,7 +1676,7 @@ async def test_update_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1860,7 +1860,7 @@ def test_delete_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - 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_queue), "__call__") as call: @@ -1876,7 +1876,7 @@ def test_delete_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1890,7 +1890,7 @@ async def test_delete_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - 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_queue), "__call__") as call: @@ -1906,7 +1906,7 @@ async def test_delete_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2092,7 +2092,7 @@ def test_purge_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - 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.purge_queue), "__call__") as call: @@ -2108,7 +2108,7 @@ def test_purge_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2122,7 +2122,7 @@ async def test_purge_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - 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.purge_queue), "__call__") as call: @@ -2138,7 +2138,7 @@ async def test_purge_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2324,7 +2324,7 @@ def test_pause_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - 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.pause_queue), "__call__") as call: @@ -2340,7 +2340,7 @@ def test_pause_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2354,7 +2354,7 @@ async def test_pause_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - 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.pause_queue), "__call__") as call: @@ -2370,7 +2370,7 @@ async def test_pause_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2556,7 +2556,7 @@ def test_resume_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - 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.resume_queue), "__call__") as call: @@ -2572,7 +2572,7 @@ def test_resume_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2586,7 +2586,7 @@ async def test_resume_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - 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.resume_queue), "__call__") as call: @@ -2602,7 +2602,7 @@ async def test_resume_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2788,7 +2788,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2804,7 +2804,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2818,7 +2818,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2834,7 +2834,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3037,7 +3037,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3053,7 +3053,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3067,7 +3067,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3083,7 +3083,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3290,7 +3290,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3308,7 +3308,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3322,7 +3322,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3342,7 +3342,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3559,7 +3559,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - 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_tasks), "__call__") as call: @@ -3575,7 +3575,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3589,7 +3589,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - 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_tasks), "__call__") as call: @@ -3607,7 +3607,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3738,7 +3738,7 @@ def test_list_tasks_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, task.Task) for i in results) @@ -3994,7 +3994,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - 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_task), "__call__") as call: @@ -4010,7 +4010,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4024,7 +4024,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - 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_task), "__call__") as call: @@ -4040,7 +4040,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4237,7 +4237,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - 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.create_task), "__call__") as call: @@ -4253,7 +4253,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4267,7 +4267,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - 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.create_task), "__call__") as call: @@ -4283,7 +4283,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4467,7 +4467,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - 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_task), "__call__") as call: @@ -4483,7 +4483,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4497,7 +4497,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - 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_task), "__call__") as call: @@ -4513,7 +4513,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4710,7 +4710,7 @@ def test_run_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - 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.run_task), "__call__") as call: @@ -4726,7 +4726,7 @@ def test_run_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4740,7 +4740,7 @@ async def test_run_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - 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.run_task), "__call__") as call: @@ -4756,7 +4756,7 @@ async def test_run_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index eae992b35285..ea08fceff065 100644 --- a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -732,7 +732,7 @@ def test_list_queues_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - 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_queues), "__call__") as call: @@ -748,7 +748,7 @@ def test_list_queues_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -762,7 +762,7 @@ async def test_list_queues_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - 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_queues), "__call__") as call: @@ -780,7 +780,7 @@ async def test_list_queues_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -911,7 +911,7 @@ def test_list_queues_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, queue.Queue) for i in results) @@ -1161,7 +1161,7 @@ def test_get_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - 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_queue), "__call__") as call: @@ -1177,7 +1177,7 @@ def test_get_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1191,7 +1191,7 @@ async def test_get_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - 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_queue), "__call__") as call: @@ -1207,7 +1207,7 @@ async def test_get_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1398,7 +1398,7 @@ def test_create_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - 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.create_queue), "__call__") as call: @@ -1414,7 +1414,7 @@ def test_create_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1428,7 +1428,7 @@ async def test_create_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - 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.create_queue), "__call__") as call: @@ -1444,7 +1444,7 @@ async def test_create_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1645,7 +1645,7 @@ def test_update_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1661,7 +1661,7 @@ def test_update_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1675,7 +1675,7 @@ async def test_update_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1691,7 +1691,7 @@ async def test_update_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1875,7 +1875,7 @@ def test_delete_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - 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_queue), "__call__") as call: @@ -1891,7 +1891,7 @@ def test_delete_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1905,7 +1905,7 @@ async def test_delete_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - 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_queue), "__call__") as call: @@ -1921,7 +1921,7 @@ async def test_delete_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2112,7 +2112,7 @@ def test_purge_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - 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.purge_queue), "__call__") as call: @@ -2128,7 +2128,7 @@ def test_purge_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2142,7 +2142,7 @@ async def test_purge_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - 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.purge_queue), "__call__") as call: @@ -2158,7 +2158,7 @@ async def test_purge_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2349,7 +2349,7 @@ def test_pause_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - 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.pause_queue), "__call__") as call: @@ -2365,7 +2365,7 @@ def test_pause_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2379,7 +2379,7 @@ async def test_pause_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - 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.pause_queue), "__call__") as call: @@ -2395,7 +2395,7 @@ async def test_pause_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2586,7 +2586,7 @@ def test_resume_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - 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.resume_queue), "__call__") as call: @@ -2602,7 +2602,7 @@ def test_resume_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2616,7 +2616,7 @@ async def test_resume_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - 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.resume_queue), "__call__") as call: @@ -2632,7 +2632,7 @@ async def test_resume_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2818,7 +2818,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2834,7 +2834,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2848,7 +2848,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2864,7 +2864,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3067,7 +3067,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3083,7 +3083,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3097,7 +3097,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3113,7 +3113,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3320,7 +3320,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3338,7 +3338,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3352,7 +3352,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3372,7 +3372,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3589,7 +3589,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - 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_tasks), "__call__") as call: @@ -3605,7 +3605,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3619,7 +3619,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - 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_tasks), "__call__") as call: @@ -3637,7 +3637,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3768,7 +3768,7 @@ def test_list_tasks_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, task.Task) for i in results) @@ -4016,7 +4016,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - 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_task), "__call__") as call: @@ -4032,7 +4032,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4046,7 +4046,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - 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_task), "__call__") as call: @@ -4062,7 +4062,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4251,7 +4251,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - 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.create_task), "__call__") as call: @@ -4267,7 +4267,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4281,7 +4281,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - 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.create_task), "__call__") as call: @@ -4297,7 +4297,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4481,7 +4481,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - 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_task), "__call__") as call: @@ -4497,7 +4497,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4511,7 +4511,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - 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_task), "__call__") as call: @@ -4527,7 +4527,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4703,7 +4703,7 @@ def test_lease_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.LeaseTasksRequest() - 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.lease_tasks), "__call__") as call: @@ -4719,7 +4719,7 @@ def test_lease_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4733,7 +4733,7 @@ async def test_lease_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.LeaseTasksRequest() - 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.lease_tasks), "__call__") as call: @@ -4751,7 +4751,7 @@ async def test_lease_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4937,7 +4937,7 @@ def test_acknowledge_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.AcknowledgeTaskRequest() - 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.acknowledge_task), "__call__") as call: @@ -4953,7 +4953,7 @@ def test_acknowledge_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4967,7 +4967,7 @@ async def test_acknowledge_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.AcknowledgeTaskRequest() - 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.acknowledge_task), "__call__") as call: @@ -4983,7 +4983,7 @@ async def test_acknowledge_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5182,7 +5182,7 @@ def test_renew_lease_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RenewLeaseRequest() - 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.renew_lease), "__call__") as call: @@ -5198,7 +5198,7 @@ def test_renew_lease_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5212,7 +5212,7 @@ async def test_renew_lease_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RenewLeaseRequest() - 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.renew_lease), "__call__") as call: @@ -5228,7 +5228,7 @@ async def test_renew_lease_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5437,7 +5437,7 @@ def test_cancel_lease_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CancelLeaseRequest() - 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.cancel_lease), "__call__") as call: @@ -5453,7 +5453,7 @@ def test_cancel_lease_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5467,7 +5467,7 @@ async def test_cancel_lease_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CancelLeaseRequest() - 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.cancel_lease), "__call__") as call: @@ -5483,7 +5483,7 @@ async def test_cancel_lease_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5682,7 +5682,7 @@ def test_run_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - 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.run_task), "__call__") as call: @@ -5698,7 +5698,7 @@ def test_run_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5712,7 +5712,7 @@ async def test_run_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - 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.run_task), "__call__") as call: @@ -5728,7 +5728,7 @@ async def test_run_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index cf998b41e0a1..86fa27e3d7cf 100644 --- a/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/packages/google-cloud-tasks/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -732,7 +732,7 @@ def test_list_queues_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - 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_queues), "__call__") as call: @@ -748,7 +748,7 @@ def test_list_queues_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -762,7 +762,7 @@ async def test_list_queues_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - 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_queues), "__call__") as call: @@ -780,7 +780,7 @@ async def test_list_queues_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -911,7 +911,7 @@ def test_list_queues_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, queue.Queue) for i in results) @@ -1165,7 +1165,7 @@ def test_get_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - 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_queue), "__call__") as call: @@ -1181,7 +1181,7 @@ def test_get_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1195,7 +1195,7 @@ async def test_get_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - 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_queue), "__call__") as call: @@ -1211,7 +1211,7 @@ async def test_get_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1406,7 +1406,7 @@ def test_create_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - 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.create_queue), "__call__") as call: @@ -1422,7 +1422,7 @@ def test_create_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1436,7 +1436,7 @@ async def test_create_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - 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.create_queue), "__call__") as call: @@ -1452,7 +1452,7 @@ async def test_create_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1657,7 +1657,7 @@ def test_update_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1673,7 +1673,7 @@ def test_update_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1687,7 +1687,7 @@ async def test_update_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1703,7 +1703,7 @@ async def test_update_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1887,7 +1887,7 @@ def test_delete_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - 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_queue), "__call__") as call: @@ -1903,7 +1903,7 @@ def test_delete_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1917,7 +1917,7 @@ async def test_delete_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - 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_queue), "__call__") as call: @@ -1933,7 +1933,7 @@ async def test_delete_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2128,7 +2128,7 @@ def test_purge_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - 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.purge_queue), "__call__") as call: @@ -2144,7 +2144,7 @@ def test_purge_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2158,7 +2158,7 @@ async def test_purge_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - 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.purge_queue), "__call__") as call: @@ -2174,7 +2174,7 @@ async def test_purge_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2369,7 +2369,7 @@ def test_pause_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - 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.pause_queue), "__call__") as call: @@ -2385,7 +2385,7 @@ def test_pause_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2399,7 +2399,7 @@ async def test_pause_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - 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.pause_queue), "__call__") as call: @@ -2415,7 +2415,7 @@ async def test_pause_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2610,7 +2610,7 @@ def test_resume_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - 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.resume_queue), "__call__") as call: @@ -2626,7 +2626,7 @@ def test_resume_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2640,7 +2640,7 @@ async def test_resume_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - 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.resume_queue), "__call__") as call: @@ -2656,7 +2656,7 @@ async def test_resume_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2842,7 +2842,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2858,7 +2858,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2872,7 +2872,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2888,7 +2888,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3091,7 +3091,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3107,7 +3107,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3121,7 +3121,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3137,7 +3137,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3344,7 +3344,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3362,7 +3362,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3376,7 +3376,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3396,7 +3396,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3613,7 +3613,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - 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_tasks), "__call__") as call: @@ -3629,7 +3629,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3643,7 +3643,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - 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_tasks), "__call__") as call: @@ -3661,7 +3661,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3792,7 +3792,7 @@ def test_list_tasks_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, task.Task) for i in results) @@ -4048,7 +4048,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - 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_task), "__call__") as call: @@ -4064,7 +4064,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4078,7 +4078,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - 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_task), "__call__") as call: @@ -4094,7 +4094,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4291,7 +4291,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - 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.create_task), "__call__") as call: @@ -4307,7 +4307,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4321,7 +4321,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - 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.create_task), "__call__") as call: @@ -4337,7 +4337,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4521,7 +4521,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - 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_task), "__call__") as call: @@ -4537,7 +4537,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4551,7 +4551,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - 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_task), "__call__") as call: @@ -4567,7 +4567,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4764,7 +4764,7 @@ def test_run_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - 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.run_task), "__call__") as call: @@ -4780,7 +4780,7 @@ def test_run_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4794,7 +4794,7 @@ async def test_run_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - 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.run_task), "__call__") as call: @@ -4810,7 +4810,7 @@ async def test_run_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"]