@@ -241,9 +241,9 @@ async def list_functions(
241
241
242
242
from google.cloud import functions_v1
243
243
244
- def sample_list_functions():
244
+ async def sample_list_functions():
245
245
# Create a client
246
- client = functions_v1.CloudFunctionsServiceClient ()
246
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
247
247
248
248
# Initialize request argument(s)
249
249
request = functions_v1.ListFunctionsRequest(
@@ -253,7 +253,7 @@ def sample_list_functions():
253
253
page_result = client.list_functions(request=request)
254
254
255
255
# Handle the response
256
- for response in page_result:
256
+ async for response in page_result:
257
257
print(response)
258
258
259
259
Args:
@@ -337,17 +337,17 @@ async def get_function(
337
337
338
338
from google.cloud import functions_v1
339
339
340
- def sample_get_function():
340
+ async def sample_get_function():
341
341
# Create a client
342
- client = functions_v1.CloudFunctionsServiceClient ()
342
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
343
343
344
344
# Initialize request argument(s)
345
345
request = functions_v1.GetFunctionRequest(
346
346
name="name_value",
347
347
)
348
348
349
349
# Make the request
350
- response = client.get_function(request=request)
350
+ response = await client.get_function(request=request)
351
351
352
352
# Handle the response
353
353
print(response)
@@ -448,9 +448,9 @@ async def create_function(
448
448
449
449
from google.cloud import functions_v1
450
450
451
- def sample_create_function():
451
+ async def sample_create_function():
452
452
# Create a client
453
- client = functions_v1.CloudFunctionsServiceClient ()
453
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
454
454
455
455
# Initialize request argument(s)
456
456
function = functions_v1.CloudFunction()
@@ -466,7 +466,7 @@ def sample_create_function():
466
466
467
467
print("Waiting for operation to complete...")
468
468
469
- response = operation.result()
469
+ response = await operation.result()
470
470
471
471
# Handle the response
472
472
print(response)
@@ -570,9 +570,9 @@ async def update_function(
570
570
571
571
from google.cloud import functions_v1
572
572
573
- def sample_update_function():
573
+ async def sample_update_function():
574
574
# Create a client
575
- client = functions_v1.CloudFunctionsServiceClient ()
575
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
576
576
577
577
# Initialize request argument(s)
578
578
function = functions_v1.CloudFunction()
@@ -587,7 +587,7 @@ def sample_update_function():
587
587
588
588
print("Waiting for operation to complete...")
589
589
590
- response = operation.result()
590
+ response = await operation.result()
591
591
592
592
# Handle the response
593
593
print(response)
@@ -698,9 +698,9 @@ async def delete_function(
698
698
699
699
from google.cloud import functions_v1
700
700
701
- def sample_delete_function():
701
+ async def sample_delete_function():
702
702
# Create a client
703
- client = functions_v1.CloudFunctionsServiceClient ()
703
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
704
704
705
705
# Initialize request argument(s)
706
706
request = functions_v1.DeleteFunctionRequest(
@@ -712,7 +712,7 @@ def sample_delete_function():
712
712
713
713
print("Waiting for operation to complete...")
714
714
715
- response = operation.result()
715
+ response = await operation.result()
716
716
717
717
# Handle the response
718
718
print(response)
@@ -832,9 +832,9 @@ async def call_function(
832
832
833
833
from google.cloud import functions_v1
834
834
835
- def sample_call_function():
835
+ async def sample_call_function():
836
836
# Create a client
837
- client = functions_v1.CloudFunctionsServiceClient ()
837
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
838
838
839
839
# Initialize request argument(s)
840
840
request = functions_v1.CallFunctionRequest(
@@ -843,7 +843,7 @@ def sample_call_function():
843
843
)
844
844
845
845
# Make the request
846
- response = client.call_function(request=request)
846
+ response = await client.call_function(request=request)
847
847
848
848
# Handle the response
849
849
print(response)
@@ -961,16 +961,16 @@ async def generate_upload_url(
961
961
962
962
from google.cloud import functions_v1
963
963
964
- def sample_generate_upload_url():
964
+ async def sample_generate_upload_url():
965
965
# Create a client
966
- client = functions_v1.CloudFunctionsServiceClient ()
966
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
967
967
968
968
# Initialize request argument(s)
969
969
request = functions_v1.GenerateUploadUrlRequest(
970
970
)
971
971
972
972
# Make the request
973
- response = client.generate_upload_url(request=request)
973
+ response = await client.generate_upload_url(request=request)
974
974
975
975
# Handle the response
976
976
print(response)
@@ -1036,16 +1036,16 @@ async def generate_download_url(
1036
1036
1037
1037
from google.cloud import functions_v1
1038
1038
1039
- def sample_generate_download_url():
1039
+ async def sample_generate_download_url():
1040
1040
# Create a client
1041
- client = functions_v1.CloudFunctionsServiceClient ()
1041
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
1042
1042
1043
1043
# Initialize request argument(s)
1044
1044
request = functions_v1.GenerateDownloadUrlRequest(
1045
1045
)
1046
1046
1047
1047
# Make the request
1048
- response = client.generate_download_url(request=request)
1048
+ response = await client.generate_download_url(request=request)
1049
1049
1050
1050
# Handle the response
1051
1051
print(response)
@@ -1108,17 +1108,17 @@ async def set_iam_policy(
1108
1108
from google.cloud import functions_v1
1109
1109
from google.iam.v1 import iam_policy_pb2 # type: ignore
1110
1110
1111
- def sample_set_iam_policy():
1111
+ async def sample_set_iam_policy():
1112
1112
# Create a client
1113
- client = functions_v1.CloudFunctionsServiceClient ()
1113
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
1114
1114
1115
1115
# Initialize request argument(s)
1116
1116
request = iam_policy_pb2.SetIamPolicyRequest(
1117
1117
resource="resource_value",
1118
1118
)
1119
1119
1120
1120
# Make the request
1121
- response = client.set_iam_policy(request=request)
1121
+ response = await client.set_iam_policy(request=request)
1122
1122
1123
1123
# Handle the response
1124
1124
print(response)
@@ -1246,17 +1246,17 @@ async def get_iam_policy(
1246
1246
from google.cloud import functions_v1
1247
1247
from google.iam.v1 import iam_policy_pb2 # type: ignore
1248
1248
1249
- def sample_get_iam_policy():
1249
+ async def sample_get_iam_policy():
1250
1250
# Create a client
1251
- client = functions_v1.CloudFunctionsServiceClient ()
1251
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
1252
1252
1253
1253
# Initialize request argument(s)
1254
1254
request = iam_policy_pb2.GetIamPolicyRequest(
1255
1255
resource="resource_value",
1256
1256
)
1257
1257
1258
1258
# Make the request
1259
- response = client.get_iam_policy(request=request)
1259
+ response = await client.get_iam_policy(request=request)
1260
1260
1261
1261
# Handle the response
1262
1262
print(response)
@@ -1384,9 +1384,9 @@ async def test_iam_permissions(
1384
1384
from google.cloud import functions_v1
1385
1385
from google.iam.v1 import iam_policy_pb2 # type: ignore
1386
1386
1387
- def sample_test_iam_permissions():
1387
+ async def sample_test_iam_permissions():
1388
1388
# Create a client
1389
- client = functions_v1.CloudFunctionsServiceClient ()
1389
+ client = functions_v1.CloudFunctionsServiceAsyncClient ()
1390
1390
1391
1391
# Initialize request argument(s)
1392
1392
request = iam_policy_pb2.TestIamPermissionsRequest(
@@ -1395,7 +1395,7 @@ def sample_test_iam_permissions():
1395
1395
)
1396
1396
1397
1397
# Make the request
1398
- response = client.test_iam_permissions(request=request)
1398
+ response = await client.test_iam_permissions(request=request)
1399
1399
1400
1400
# Handle the response
1401
1401
print(response)
0 commit comments