@@ -214,9 +214,9 @@ async def export_assets(self,
214214
215215 from google.cloud import asset_v1
216216
217- def sample_export_assets():
217+ async def sample_export_assets():
218218 # Create a client
219- client = asset_v1.AssetServiceClient ()
219+ client = asset_v1.AssetServiceAsyncClient ()
220220
221221 # Initialize request argument(s)
222222 output_config = asset_v1.OutputConfig()
@@ -232,7 +232,7 @@ def sample_export_assets():
232232
233233 print("Waiting for operation to complete...")
234234
235- response = operation.result()
235+ response = await operation.result()
236236
237237 # Handle the response
238238 print(response)
@@ -310,9 +310,9 @@ async def list_assets(self,
310310
311311 from google.cloud import asset_v1
312312
313- def sample_list_assets():
313+ async def sample_list_assets():
314314 # Create a client
315- client = asset_v1.AssetServiceClient ()
315+ client = asset_v1.AssetServiceAsyncClient ()
316316
317317 # Initialize request argument(s)
318318 request = asset_v1.ListAssetsRequest(
@@ -323,7 +323,7 @@ def sample_list_assets():
323323 page_result = client.list_assets(request=request)
324324
325325 # Handle the response
326- for response in page_result:
326+ async for response in page_result:
327327 print(response)
328328
329329 Args:
@@ -423,17 +423,17 @@ async def batch_get_assets_history(self,
423423
424424 from google.cloud import asset_v1
425425
426- def sample_batch_get_assets_history():
426+ async def sample_batch_get_assets_history():
427427 # Create a client
428- client = asset_v1.AssetServiceClient ()
428+ client = asset_v1.AssetServiceAsyncClient ()
429429
430430 # Initialize request argument(s)
431431 request = asset_v1.BatchGetAssetsHistoryRequest(
432432 parent="parent_value",
433433 )
434434
435435 # Make the request
436- response = client.batch_get_assets_history(request=request)
436+ response = await client.batch_get_assets_history(request=request)
437437
438438 # Handle the response
439439 print(response)
@@ -504,9 +504,9 @@ async def create_feed(self,
504504
505505 from google.cloud import asset_v1
506506
507- def sample_create_feed():
507+ async def sample_create_feed():
508508 # Create a client
509- client = asset_v1.AssetServiceClient ()
509+ client = asset_v1.AssetServiceAsyncClient ()
510510
511511 # Initialize request argument(s)
512512 feed = asset_v1.Feed()
@@ -519,7 +519,7 @@ def sample_create_feed():
519519 )
520520
521521 # Make the request
522- response = client.create_feed(request=request)
522+ response = await client.create_feed(request=request)
523523
524524 # Handle the response
525525 print(response)
@@ -614,17 +614,17 @@ async def get_feed(self,
614614
615615 from google.cloud import asset_v1
616616
617- def sample_get_feed():
617+ async def sample_get_feed():
618618 # Create a client
619- client = asset_v1.AssetServiceClient ()
619+ client = asset_v1.AssetServiceAsyncClient ()
620620
621621 # Initialize request argument(s)
622622 request = asset_v1.GetFeedRequest(
623623 name="name_value",
624624 )
625625
626626 # Make the request
627- response = client.get_feed(request=request)
627+ response = await client.get_feed(request=request)
628628
629629 # Handle the response
630630 print(response)
@@ -722,17 +722,17 @@ async def list_feeds(self,
722722
723723 from google.cloud import asset_v1
724724
725- def sample_list_feeds():
725+ async def sample_list_feeds():
726726 # Create a client
727- client = asset_v1.AssetServiceClient ()
727+ client = asset_v1.AssetServiceAsyncClient ()
728728
729729 # Initialize request argument(s)
730730 request = asset_v1.ListFeedsRequest(
731731 parent="parent_value",
732732 )
733733
734734 # Make the request
735- response = client.list_feeds(request=request)
735+ response = await client.list_feeds(request=request)
736736
737737 # Handle the response
738738 print(response)
@@ -824,9 +824,9 @@ async def update_feed(self,
824824
825825 from google.cloud import asset_v1
826826
827- def sample_update_feed():
827+ async def sample_update_feed():
828828 # Create a client
829- client = asset_v1.AssetServiceClient ()
829+ client = asset_v1.AssetServiceAsyncClient ()
830830
831831 # Initialize request argument(s)
832832 feed = asset_v1.Feed()
@@ -837,7 +837,7 @@ def sample_update_feed():
837837 )
838838
839839 # Make the request
840- response = client.update_feed(request=request)
840+ response = await client.update_feed(request=request)
841841
842842 # Handle the response
843843 print(response)
@@ -928,17 +928,17 @@ async def delete_feed(self,
928928
929929 from google.cloud import asset_v1
930930
931- def sample_delete_feed():
931+ async def sample_delete_feed():
932932 # Create a client
933- client = asset_v1.AssetServiceClient ()
933+ client = asset_v1.AssetServiceAsyncClient ()
934934
935935 # Initialize request argument(s)
936936 request = asset_v1.DeleteFeedRequest(
937937 name="name_value",
938938 )
939939
940940 # Make the request
941- client.delete_feed(request=request)
941+ await client.delete_feed(request=request)
942942
943943 Args:
944944 request (Union[google.cloud.asset_v1.types.DeleteFeedRequest, dict]):
@@ -1023,9 +1023,9 @@ async def search_all_resources(self,
10231023
10241024 from google.cloud import asset_v1
10251025
1026- def sample_search_all_resources():
1026+ async def sample_search_all_resources():
10271027 # Create a client
1028- client = asset_v1.AssetServiceClient ()
1028+ client = asset_v1.AssetServiceAsyncClient ()
10291029
10301030 # Initialize request argument(s)
10311031 request = asset_v1.SearchAllResourcesRequest(
@@ -1036,7 +1036,7 @@ def sample_search_all_resources():
10361036 page_result = client.search_all_resources(request=request)
10371037
10381038 # Handle the response
1039- for response in page_result:
1039+ async for response in page_result:
10401040 print(response)
10411041
10421042 Args:
@@ -1229,9 +1229,9 @@ async def search_all_iam_policies(self,
12291229
12301230 from google.cloud import asset_v1
12311231
1232- def sample_search_all_iam_policies():
1232+ async def sample_search_all_iam_policies():
12331233 # Create a client
1234- client = asset_v1.AssetServiceClient ()
1234+ client = asset_v1.AssetServiceAsyncClient ()
12351235
12361236 # Initialize request argument(s)
12371237 request = asset_v1.SearchAllIamPoliciesRequest(
@@ -1242,7 +1242,7 @@ def sample_search_all_iam_policies():
12421242 page_result = client.search_all_iam_policies(request=request)
12431243
12441244 # Handle the response
1245- for response in page_result:
1245+ async for response in page_result:
12461246 print(response)
12471247
12481248 Args:
@@ -1411,9 +1411,9 @@ async def analyze_iam_policy(self,
14111411
14121412 from google.cloud import asset_v1
14131413
1414- def sample_analyze_iam_policy():
1414+ async def sample_analyze_iam_policy():
14151415 # Create a client
1416- client = asset_v1.AssetServiceClient ()
1416+ client = asset_v1.AssetServiceAsyncClient ()
14171417
14181418 # Initialize request argument(s)
14191419 analysis_query = asset_v1.IamPolicyAnalysisQuery()
@@ -1424,7 +1424,7 @@ def sample_analyze_iam_policy():
14241424 )
14251425
14261426 # Make the request
1427- response = client.analyze_iam_policy(request=request)
1427+ response = await client.analyze_iam_policy(request=request)
14281428
14291429 # Handle the response
14301430 print(response)
@@ -1505,9 +1505,9 @@ async def analyze_iam_policy_longrunning(self,
15051505
15061506 from google.cloud import asset_v1
15071507
1508- def sample_analyze_iam_policy_longrunning():
1508+ async def sample_analyze_iam_policy_longrunning():
15091509 # Create a client
1510- client = asset_v1.AssetServiceClient ()
1510+ client = asset_v1.AssetServiceAsyncClient ()
15111511
15121512 # Initialize request argument(s)
15131513 analysis_query = asset_v1.IamPolicyAnalysisQuery()
@@ -1526,7 +1526,7 @@ def sample_analyze_iam_policy_longrunning():
15261526
15271527 print("Waiting for operation to complete...")
15281528
1529- response = operation.result()
1529+ response = await operation.result()
15301530
15311531 # Handle the response
15321532 print(response)
0 commit comments