diff --git a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py index 69bf10d..c6b5056 100644 --- a/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py +++ b/google/cloud/recaptchaenterprise_v1/services/recaptcha_enterprise_service/async_client.py @@ -251,9 +251,9 @@ async def create_assessment( from google.cloud import recaptchaenterprise_v1 - def sample_create_assessment(): + async def sample_create_assessment(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.CreateAssessmentRequest( @@ -261,7 +261,7 @@ def sample_create_assessment(): ) # Make the request - response = client.create_assessment(request=request) + response = await client.create_assessment(request=request) # Handle the response print(response) @@ -355,9 +355,9 @@ async def annotate_assessment( from google.cloud import recaptchaenterprise_v1 - def sample_annotate_assessment(): + async def sample_annotate_assessment(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.AnnotateAssessmentRequest( @@ -365,7 +365,7 @@ def sample_annotate_assessment(): ) # Make the request - response = client.annotate_assessment(request=request) + response = await client.annotate_assessment(request=request) # Handle the response print(response) @@ -462,9 +462,9 @@ async def create_key( from google.cloud import recaptchaenterprise_v1 - def sample_create_key(): + async def sample_create_key(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) key = recaptchaenterprise_v1.Key() @@ -476,7 +476,7 @@ def sample_create_key(): ) # Make the request - response = client.create_key(request=request) + response = await client.create_key(request=request) # Handle the response print(response) @@ -540,9 +540,9 @@ async def list_keys( from google.cloud import recaptchaenterprise_v1 - def sample_list_keys(): + async def sample_list_keys(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.ListKeysRequest( @@ -553,7 +553,7 @@ def sample_list_keys(): page_result = client.list_keys(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -625,9 +625,9 @@ async def get_key( from google.cloud import recaptchaenterprise_v1 - def sample_get_key(): + async def sample_get_key(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.GetKeyRequest( @@ -635,7 +635,7 @@ def sample_get_key(): ) # Make the request - response = client.get_key(request=request) + response = await client.get_key(request=request) # Handle the response print(response) @@ -698,9 +698,9 @@ async def update_key( from google.cloud import recaptchaenterprise_v1 - def sample_update_key(): + async def sample_update_key(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) key = recaptchaenterprise_v1.Key() @@ -711,7 +711,7 @@ def sample_update_key(): ) # Make the request - response = client.update_key(request=request) + response = await client.update_key(request=request) # Handle the response print(response) @@ -774,9 +774,9 @@ async def delete_key( from google.cloud import recaptchaenterprise_v1 - def sample_delete_key(): + async def sample_delete_key(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.DeleteKeyRequest( @@ -784,7 +784,7 @@ def sample_delete_key(): ) # Make the request - client.delete_key(request=request) + await client.delete_key(request=request) Args: request (Union[google.cloud.recaptchaenterprise_v1.types.DeleteKeyRequest, dict]): @@ -840,9 +840,9 @@ async def migrate_key( from google.cloud import recaptchaenterprise_v1 - def sample_migrate_key(): + async def sample_migrate_key(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.MigrateKeyRequest( @@ -850,7 +850,7 @@ def sample_migrate_key(): ) # Make the request - response = client.migrate_key(request=request) + response = await client.migrate_key(request=request) # Handle the response print(response) @@ -915,9 +915,9 @@ async def get_metrics( from google.cloud import recaptchaenterprise_v1 - def sample_get_metrics(): + async def sample_get_metrics(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.GetMetricsRequest( @@ -925,7 +925,7 @@ def sample_get_metrics(): ) # Make the request - response = client.get_metrics(request=request) + response = await client.get_metrics(request=request) # Handle the response print(response) @@ -1010,9 +1010,9 @@ async def list_related_account_groups( from google.cloud import recaptchaenterprise_v1 - def sample_list_related_account_groups(): + async def sample_list_related_account_groups(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.ListRelatedAccountGroupsRequest( @@ -1023,7 +1023,7 @@ def sample_list_related_account_groups(): page_result = client.list_related_account_groups(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1120,9 +1120,9 @@ async def list_related_account_group_memberships( from google.cloud import recaptchaenterprise_v1 - def sample_list_related_account_group_memberships(): + async def sample_list_related_account_group_memberships(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.ListRelatedAccountGroupMembershipsRequest( @@ -1133,7 +1133,7 @@ def sample_list_related_account_group_memberships(): page_result = client.list_related_account_group_memberships(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1232,9 +1232,9 @@ async def search_related_account_group_memberships( from google.cloud import recaptchaenterprise_v1 - def sample_search_related_account_group_memberships(): + async def sample_search_related_account_group_memberships(): # Create a client - client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient() + client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceAsyncClient() # Initialize request argument(s) request = recaptchaenterprise_v1.SearchRelatedAccountGroupMembershipsRequest( @@ -1245,7 +1245,7 @@ def sample_search_related_account_group_memberships(): page_result = client.search_related_account_group_memberships(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py b/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py index 7f7897d..f664f9a 100644 --- a/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py +++ b/tests/unit/gapic/recaptchaenterprise_v1/test_recaptcha_enterprise_service.py @@ -782,7 +782,7 @@ def test_create_assessment_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.CreateAssessmentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -800,7 +800,7 @@ def test_create_assessment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -814,7 +814,7 @@ async def test_create_assessment_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.CreateAssessmentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -834,7 +834,7 @@ async def test_create_assessment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1033,7 +1033,7 @@ def test_annotate_assessment_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.AnnotateAssessmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1051,7 +1051,7 @@ def test_annotate_assessment_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1065,7 +1065,7 @@ async def test_annotate_assessment_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.AnnotateAssessmentRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1085,7 +1085,7 @@ async def test_annotate_assessment_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1288,7 +1288,7 @@ def test_create_key_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.CreateKeyRequest() - 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_key), "__call__") as call: @@ -1304,7 +1304,7 @@ def test_create_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1318,7 +1318,7 @@ async def test_create_key_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.CreateKeyRequest() - 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_key), "__call__") as call: @@ -1336,7 +1336,7 @@ async def test_create_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1438,7 +1438,7 @@ def test_list_keys_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.ListKeysRequest() - 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_keys), "__call__") as call: @@ -1454,7 +1454,7 @@ def test_list_keys_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1468,7 +1468,7 @@ async def test_list_keys_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.ListKeysRequest() - 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_keys), "__call__") as call: @@ -1486,7 +1486,7 @@ async def test_list_keys_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1535,7 +1535,7 @@ def test_list_keys_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, recaptchaenterprise.Key) for i in results) @@ -1781,7 +1781,7 @@ def test_get_key_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.GetKeyRequest() - 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_key), "__call__") as call: @@ -1797,7 +1797,7 @@ def test_get_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1811,7 +1811,7 @@ async def test_get_key_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.GetKeyRequest() - 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_key), "__call__") as call: @@ -1829,7 +1829,7 @@ async def test_get_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1936,7 +1936,7 @@ def test_update_key_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.UpdateKeyRequest() - request.key.name = "key.name/value" + request.key.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_key), "__call__") as call: @@ -1952,7 +1952,7 @@ def test_update_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "key.name=key.name/value", + "key.name=name_value", ) in kw["metadata"] @@ -1966,7 +1966,7 @@ async def test_update_key_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.UpdateKeyRequest() - request.key.name = "key.name/value" + request.key.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_key), "__call__") as call: @@ -1984,7 +1984,7 @@ async def test_update_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "key.name=key.name/value", + "key.name=name_value", ) in kw["metadata"] @@ -2078,7 +2078,7 @@ def test_delete_key_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.DeleteKeyRequest() - 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_key), "__call__") as call: @@ -2094,7 +2094,7 @@ def test_delete_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2108,7 +2108,7 @@ async def test_delete_key_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.DeleteKeyRequest() - 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_key), "__call__") as call: @@ -2124,7 +2124,7 @@ async def test_delete_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2231,7 +2231,7 @@ def test_migrate_key_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.MigrateKeyRequest() - 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.migrate_key), "__call__") as call: @@ -2247,7 +2247,7 @@ def test_migrate_key_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2261,7 +2261,7 @@ async def test_migrate_key_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.MigrateKeyRequest() - 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.migrate_key), "__call__") as call: @@ -2279,7 +2279,7 @@ async def test_migrate_key_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2381,7 +2381,7 @@ def test_get_metrics_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.GetMetricsRequest() - 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_metrics), "__call__") as call: @@ -2397,7 +2397,7 @@ def test_get_metrics_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2411,7 +2411,7 @@ async def test_get_metrics_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.GetMetricsRequest() - 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_metrics), "__call__") as call: @@ -2429,7 +2429,7 @@ async def test_get_metrics_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2620,7 +2620,7 @@ def test_list_related_account_groups_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.ListRelatedAccountGroupsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2638,7 +2638,7 @@ def test_list_related_account_groups_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2652,7 +2652,7 @@ async def test_list_related_account_groups_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.ListRelatedAccountGroupsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2672,7 +2672,7 @@ async def test_list_related_account_groups_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2809,7 +2809,7 @@ def test_list_related_account_groups_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, recaptchaenterprise.RelatedAccountGroup) for i in results @@ -3075,7 +3075,7 @@ def test_list_related_account_group_memberships_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.ListRelatedAccountGroupMembershipsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3095,7 +3095,7 @@ def test_list_related_account_group_memberships_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3109,7 +3109,7 @@ async def test_list_related_account_group_memberships_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.ListRelatedAccountGroupMembershipsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3129,7 +3129,7 @@ async def test_list_related_account_group_memberships_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3270,7 +3270,7 @@ def test_list_related_account_group_memberships_pager(transport_name: str = "grp assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, recaptchaenterprise.RelatedAccountGroupMembership) @@ -3540,7 +3540,7 @@ def test_search_related_account_group_memberships_field_headers(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.SearchRelatedAccountGroupMembershipsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3560,7 +3560,7 @@ def test_search_related_account_group_memberships_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3574,7 +3574,7 @@ async def test_search_related_account_group_memberships_field_headers_async(): # a field header. Set these to a non-empty value. request = recaptchaenterprise.SearchRelatedAccountGroupMembershipsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3594,7 +3594,7 @@ async def test_search_related_account_group_memberships_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3745,7 +3745,7 @@ def test_search_related_account_group_memberships_pager(transport_name: str = "g assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all( isinstance(i, recaptchaenterprise.RelatedAccountGroupMembership)