diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py index eea3d41e90c9..c612cd59f8b9 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -236,6 +236,32 @@ async def export_assets( the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_export_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + output_config = asset_v1.OutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.ExportAssetsRequest( + parent="parent_value", + output_config=output_config, + ) + + # Make the request + operation = client.export_assets(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + Args: request (Union[google.cloud.asset_v1.types.ExportAssetsRequest, dict]): The request object. Export asset request. @@ -299,6 +325,25 @@ async def list_assets( r"""Lists assets with time and resource types and returns paged results in response. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_list_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1.types.ListAssetsRequest, dict]): The request object. ListAssets request. @@ -395,6 +440,26 @@ async def batch_get_assets_history( specified asset does not exist, this API returns an INVALID_ARGUMENT error. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_batch_get_assets_history(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.BatchGetAssetsHistoryRequest( + parent="parent_value", + ) + + # Make the request + response = client.batch_get_assets_history(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.BatchGetAssetsHistoryRequest, dict]): The request object. Batch get assets history request. @@ -454,6 +519,31 @@ async def create_feed( project/folder/organization to listen to its asset updates. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_create_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = client.create_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.CreateFeedRequest, dict]): The request object. Create asset feed request. @@ -536,6 +626,25 @@ async def get_feed( ) -> asset_service.Feed: r"""Gets details about an asset feed. + .. code-block:: + + from google.cloud import asset_v1 + + def sample_get_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = client.get_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.GetFeedRequest, dict]): The request object. Get asset feed request. @@ -624,6 +733,26 @@ async def list_feeds( r"""Lists all asset feeds in a parent project/folder/organization. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_list_feeds(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_feeds(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.ListFeedsRequest, dict]): The request object. List asset feeds request. @@ -706,6 +835,28 @@ async def update_feed( ) -> asset_service.Feed: r"""Updates an asset feed configuration. + .. code-block:: + + from google.cloud import asset_v1 + + def sample_update_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = client.update_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.UpdateFeedRequest, dict]): The request object. Update asset feed request. @@ -786,6 +937,22 @@ async def delete_feed( ) -> None: r"""Deletes an asset feed. + .. code-block:: + + from google.cloud import asset_v1 + + def sample_delete_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = client.delete_feed(request=request) + Args: request (Union[google.cloud.asset_v1.types.DeleteFeedRequest, dict]): The request object. @@ -866,6 +1033,25 @@ async def search_all_resources( the ``cloudasset.assets.searchAllResources`` permission on the desired scope, otherwise the request will be rejected. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_search_all_resources(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1.types.SearchAllResourcesRequest, dict]): The request object. Search all resources request. @@ -1047,6 +1233,25 @@ async def search_all_iam_policies( ``cloudasset.assets.searchAllIamPolicies`` permission on the desired scope, otherwise the request will be rejected. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_search_all_iam_policies(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1.types.SearchAllIamPoliciesRequest, dict]): The request object. Search all IAM policies request. @@ -1204,6 +1409,29 @@ async def analyze_iam_policy( r"""Analyzes IAM policies to answer which identities have what accesses on which resources. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_analyze_iam_policy(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + request = asset_v1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = client.analyze_iam_policy(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.AnalyzeIamPolicyRequest, dict]): The request object. A request message for @@ -1275,6 +1503,35 @@ async def analyze_iam_policy_longrunning( to poll the operation result. The metadata contains the metadata for the long-running operation. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_analyze_iam_policy_longrunning(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + output_config = asset_v1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.AnalyzeIamPolicyLongrunningRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.analyze_iam_policy_longrunning(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + Args: request (Union[google.cloud.asset_v1.types.AnalyzeIamPolicyLongrunningRequest, dict]): The request object. A request message for @@ -1344,6 +1601,27 @@ async def analyze_move( subject to change before the actual resource migration takes place. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_analyze_move(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.AnalyzeMoveRequest( + resource="resource_value", + destination_parent="destination_parent_value", + ) + + # Make the request + response = client.analyze_move(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.AnalyzeMoveRequest, dict]): The request object. The request message for performing diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/client.py b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/client.py index 34c00ac491c4..cf05c4715b4c 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/client.py @@ -482,6 +482,33 @@ def export_assets( the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_export_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + output_config = asset_v1.OutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.ExportAssetsRequest( + parent="parent_value", + output_config=output_config, + ) + + # Make the request + operation = client.export_assets(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + Args: request (Union[google.cloud.asset_v1.types.ExportAssetsRequest, dict]): The request object. Export asset request. @@ -546,6 +573,26 @@ def list_assets( r"""Lists assets with time and resource types and returns paged results in response. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_list_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1.types.ListAssetsRequest, dict]): The request object. ListAssets request. @@ -632,6 +679,27 @@ def batch_get_assets_history( specified asset does not exist, this API returns an INVALID_ARGUMENT error. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_batch_get_assets_history(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.BatchGetAssetsHistoryRequest( + parent="parent_value", + ) + + # Make the request + response = client.batch_get_assets_history(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.BatchGetAssetsHistoryRequest, dict]): The request object. Batch get assets history request. @@ -682,6 +750,32 @@ def create_feed( project/folder/organization to listen to its asset updates. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_create_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = client.create_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.CreateFeedRequest, dict]): The request object. Create asset feed request. @@ -764,6 +858,26 @@ def get_feed( ) -> asset_service.Feed: r"""Gets details about an asset feed. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_get_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = client.get_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.GetFeedRequest, dict]): The request object. Get asset feed request. @@ -842,6 +956,27 @@ def list_feeds( r"""Lists all asset feeds in a parent project/folder/organization. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_list_feeds(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_feeds(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.ListFeedsRequest, dict]): The request object. List asset feeds request. @@ -914,6 +1049,29 @@ def update_feed( ) -> asset_service.Feed: r"""Updates an asset feed configuration. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_update_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = client.update_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.UpdateFeedRequest, dict]): The request object. Update asset feed request. @@ -994,6 +1152,23 @@ def delete_feed( ) -> None: r"""Deletes an asset feed. + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_delete_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = client.delete_feed(request=request) + Args: request (Union[google.cloud.asset_v1.types.DeleteFeedRequest, dict]): The request object. @@ -1064,6 +1239,26 @@ def search_all_resources( the ``cloudasset.assets.searchAllResources`` permission on the desired scope, otherwise the request will be rejected. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_search_all_resources(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1.types.SearchAllResourcesRequest, dict]): The request object. Search all resources request. @@ -1236,6 +1431,26 @@ def search_all_iam_policies( ``cloudasset.assets.searchAllIamPolicies`` permission on the desired scope, otherwise the request will be rejected. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_search_all_iam_policies(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1.types.SearchAllIamPoliciesRequest, dict]): The request object. Search all IAM policies request. @@ -1384,6 +1599,30 @@ def analyze_iam_policy( r"""Analyzes IAM policies to answer which identities have what accesses on which resources. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_analyze_iam_policy(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + request = asset_v1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = client.analyze_iam_policy(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.AnalyzeIamPolicyRequest, dict]): The request object. A request message for @@ -1447,6 +1686,36 @@ def analyze_iam_policy_longrunning( to poll the operation result. The metadata contains the metadata for the long-running operation. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_analyze_iam_policy_longrunning(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + output_config = asset_v1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.AnalyzeIamPolicyLongrunningRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.analyze_iam_policy_longrunning(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + Args: request (Union[google.cloud.asset_v1.types.AnalyzeIamPolicyLongrunningRequest, dict]): The request object. A request message for @@ -1519,6 +1788,28 @@ def analyze_move( subject to change before the actual resource migration takes place. + + + .. code-block:: + + from google.cloud import asset_v1 + + def sample_analyze_move(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.AnalyzeMoveRequest( + resource="resource_value", + destination_parent="destination_parent_value", + ) + + # Make the request + response = client.analyze_move(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1.types.AnalyzeMoveRequest, dict]): The request object. The request message for performing diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py index de37e4501604..4fe4fdaf5723 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py @@ -216,6 +216,25 @@ async def search_all_resources( cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be rejected. + + .. code-block:: + + from google.cloud import asset_v1p1beta1 + + def sample_search_all_resources(): + # Create a client + client = asset_v1p1beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1p1beta1.types.SearchAllResourcesRequest, dict]): The request object. Search all resources request. @@ -336,6 +355,25 @@ async def search_all_iam_policies( cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be rejected. + + .. code-block:: + + from google.cloud import asset_v1p1beta1 + + def sample_search_all_iam_policies(): + # Create a client + client = asset_v1p1beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1p1beta1.types.SearchAllIamPoliciesRequest, dict]): The request object. Search all IAM policies request. diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/client.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/client.py index 518361964040..197182d4120f 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/services/asset_service/client.py @@ -401,6 +401,26 @@ def search_all_resources( cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be rejected. + + + .. code-block:: + + from google.cloud import asset_v1p1beta1 + + def sample_search_all_resources(): + # Create a client + client = asset_v1p1beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1p1beta1.types.SearchAllResourcesRequest, dict]): The request object. Search all resources request. @@ -511,6 +531,26 @@ def search_all_iam_policies( cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be rejected. + + + .. code-block:: + + from google.cloud import asset_v1p1beta1 + + def sample_search_all_iam_policies(): + # Create a client + client = asset_v1p1beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1p1beta1.types.SearchAllIamPoliciesRequest, dict]): The request object. Search all IAM policies request. diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py index 1bdca56ca90a..f8e1bdd96281 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py @@ -210,6 +210,31 @@ async def create_feed( project/folder/organization to listen to its asset updates. + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_create_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = client.create_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.CreateFeedRequest, dict]): The request object. Create asset feed request. @@ -292,6 +317,25 @@ async def get_feed( ) -> asset_service.Feed: r"""Gets details about an asset feed. + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_get_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = client.get_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.GetFeedRequest, dict]): The request object. Get asset feed request. @@ -380,6 +424,26 @@ async def list_feeds( r"""Lists all asset feeds in a parent project/folder/organization. + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_list_feeds(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_feeds(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.ListFeedsRequest, dict]): The request object. List asset feeds request. @@ -462,6 +526,28 @@ async def update_feed( ) -> asset_service.Feed: r"""Updates an asset feed configuration. + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_update_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = client.update_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.UpdateFeedRequest, dict]): The request object. Update asset feed request. @@ -542,6 +628,22 @@ async def delete_feed( ) -> None: r"""Deletes an asset feed. + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_delete_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = client.delete_feed(request=request) + Args: request (Union[google.cloud.asset_v1p2beta1.types.DeleteFeedRequest, dict]): The request object. diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/client.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/client.py index b34f037dd762..15aae024bcd5 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/services/asset_service/client.py @@ -404,6 +404,32 @@ def create_feed( project/folder/organization to listen to its asset updates. + + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_create_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = client.create_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.CreateFeedRequest, dict]): The request object. Create asset feed request. @@ -486,6 +512,26 @@ def get_feed( ) -> asset_service.Feed: r"""Gets details about an asset feed. + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_get_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = client.get_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.GetFeedRequest, dict]): The request object. Get asset feed request. @@ -564,6 +610,27 @@ def list_feeds( r"""Lists all asset feeds in a parent project/folder/organization. + + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_list_feeds(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_feeds(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.ListFeedsRequest, dict]): The request object. List asset feeds request. @@ -636,6 +703,29 @@ def update_feed( ) -> asset_service.Feed: r"""Updates an asset feed configuration. + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_update_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = client.update_feed(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p2beta1.types.UpdateFeedRequest, dict]): The request object. Update asset feed request. @@ -716,6 +806,23 @@ def delete_feed( ) -> None: r"""Deletes an asset feed. + + .. code-block:: + + from google.cloud import asset_v1p2beta1 + + def sample_delete_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = client.delete_feed(request=request) + Args: request (Union[google.cloud.asset_v1p2beta1.types.DeleteFeedRequest, dict]): The request object. diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/async_client.py index e0b315e41616..171a4d059331 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/async_client.py @@ -211,6 +211,29 @@ async def analyze_iam_policy( [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request. + + .. code-block:: + + from google.cloud import asset_v1p4beta1 + + def sample_analyze_iam_policy(): + # Create a client + client = asset_v1p4beta1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + request = asset_v1p4beta1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = client.analyze_iam_policy(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p4beta1.types.AnalyzeIamPolicyRequest, dict]): The request object. A request message for @@ -275,6 +298,35 @@ async def export_iam_policy_analysis( allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests. + + .. code-block:: + + from google.cloud import asset_v1p4beta1 + + def sample_export_iam_policy_analysis(): + # Create a client + client = asset_v1p4beta1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + output_config = asset_v1p4beta1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1p4beta1.ExportIamPolicyAnalysisRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.export_iam_policy_analysis(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + Args: request (Union[google.cloud.asset_v1p4beta1.types.ExportIamPolicyAnalysisRequest, dict]): The request object. A request message for diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/client.py b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/client.py index a5ae198de6a8..525d9bc79bdf 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p4beta1/services/asset_service/client.py @@ -396,6 +396,30 @@ def analyze_iam_policy( [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request. + + + .. code-block:: + + from google.cloud import asset_v1p4beta1 + + def sample_analyze_iam_policy(): + # Create a client + client = asset_v1p4beta1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + request = asset_v1p4beta1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = client.analyze_iam_policy(request=request) + + # Handle response + print(response) + Args: request (Union[google.cloud.asset_v1p4beta1.types.AnalyzeIamPolicyRequest, dict]): The request object. A request message for @@ -452,6 +476,36 @@ def export_iam_policy_analysis( allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests. + + + .. code-block:: + + from google.cloud import asset_v1p4beta1 + + def sample_export_iam_policy_analysis(): + # Create a client + client = asset_v1p4beta1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + output_config = asset_v1p4beta1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1p4beta1.ExportIamPolicyAnalysisRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.export_iam_policy_analysis(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + Args: request (Union[google.cloud.asset_v1p4beta1.types.ExportIamPolicyAnalysisRequest, dict]): The request object. A request message for diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py index a27873f81435..0f395448d560 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py @@ -218,6 +218,25 @@ async def list_assets( r"""Lists assets with time and resource types and returns paged results in response. + + .. code-block:: + + from google.cloud import asset_v1p5beta1 + + def sample_list_assets(): + # Create a client + client = asset_v1p5beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p5beta1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1p5beta1.types.ListAssetsRequest, dict]): The request object. ListAssets request. diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/client.py b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/client.py index 73737648849d..d7aa81daa0dc 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/services/asset_service/client.py @@ -441,6 +441,26 @@ def list_assets( r"""Lists assets with time and resource types and returns paged results in response. + + + .. code-block:: + + from google.cloud import asset_v1p5beta1 + + def sample_list_assets(): + # Create a client + client = asset_v1p5beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p5beta1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + for response in page_result: + print(response) + Args: request (Union[google.cloud.asset_v1p5beta1.types.ListAssetsRequest, dict]): The request object. ListAssets request. diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_async.py new file mode 100644 index 000000000000..1759b7e38c2c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_async] +from google.cloud import asset_v1 + + +async def sample_analyze_iam_policy(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + request = asset_v1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = await client.analyze_iam_policy(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_async.py new file mode 100644 index 000000000000..51ef3ab86a18 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeIamPolicyLongrunning +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_async] +from google.cloud import asset_v1 + + +async def sample_analyze_iam_policy_longrunning(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + output_config = asset_v1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.AnalyzeIamPolicyLongrunningRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.analyze_iam_policy_longrunning(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_sync.py new file mode 100644 index 000000000000..eee8fb97ed75 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeIamPolicyLongrunning +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_sync] +from google.cloud import asset_v1 + + +def sample_analyze_iam_policy_longrunning(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + output_config = asset_v1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.AnalyzeIamPolicyLongrunningRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.analyze_iam_policy_longrunning(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_sync.py new file mode 100644 index 000000000000..9dd189550952 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_sync] +from google.cloud import asset_v1 + + +def sample_analyze_iam_policy(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1.IamPolicyAnalysisQuery() + analysis_query.scope = "scope_value" + + request = asset_v1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = client.analyze_iam_policy(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_move_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_move_async.py new file mode 100644 index 000000000000..c10915fb45fa --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_move_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeMove +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_AnalyzeMove_async] +from google.cloud import asset_v1 + + +async def sample_analyze_move(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.AnalyzeMoveRequest( + resource="resource_value", + destination_parent="destination_parent_value", + ) + + # Make the request + response = await client.analyze_move(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_AnalyzeMove_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_move_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_move_sync.py new file mode 100644 index 000000000000..b4c6b03e064a --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_move_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeMove +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_AnalyzeMove_sync] +from google.cloud import asset_v1 + + +def sample_analyze_move(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.AnalyzeMoveRequest( + resource="resource_value", + destination_parent="destination_parent_value", + ) + + # Make the request + response = client.analyze_move(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_AnalyzeMove_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_async.py new file mode 100644 index 000000000000..edae4c7f9289 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchGetAssetsHistory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_async] +from google.cloud import asset_v1 + + +async def sample_batch_get_assets_history(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.BatchGetAssetsHistoryRequest( + parent="parent_value", + ) + + # Make the request + response = await client.batch_get_assets_history(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_sync.py new file mode 100644 index 000000000000..5bf8c8de15fb --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchGetAssetsHistory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_sync] +from google.cloud import asset_v1 + + +def sample_batch_get_assets_history(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.BatchGetAssetsHistoryRequest( + parent="parent_value", + ) + + # Make the request + response = client.batch_get_assets_history(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_async.py new file mode 100644 index 000000000000..a988dfe5d494 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_CreateFeed_async] +from google.cloud import asset_v1 + + +async def sample_create_feed(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = await client.create_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_CreateFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_sync.py new file mode 100644 index 000000000000..e33028822916 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_CreateFeed_sync] +from google.cloud import asset_v1 + + +def sample_create_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = client.create_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_CreateFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_async.py new file mode 100644 index 000000000000..d9fea4281440 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_DeleteFeed_async] +from google.cloud import asset_v1 + + +async def sample_delete_feed(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = await client.delete_feed(request=request) + + +# [END cloudasset_generated_asset_v1_AssetService_DeleteFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_sync.py new file mode 100644 index 000000000000..f9008baa7b8b --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_DeleteFeed_sync] +from google.cloud import asset_v1 + + +def sample_delete_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = client.delete_feed(request=request) + + +# [END cloudasset_generated_asset_v1_AssetService_DeleteFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_export_assets_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_export_assets_async.py new file mode 100644 index 000000000000..f384bea0adfb --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_export_assets_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportAssets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_ExportAssets_async] +from google.cloud import asset_v1 + + +async def sample_export_assets(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + output_config = asset_v1.OutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.ExportAssetsRequest( + parent="parent_value", + output_config=output_config, + ) + + # Make the request + operation = client.export_assets(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_ExportAssets_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_export_assets_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_export_assets_sync.py new file mode 100644 index 000000000000..4ac84ea71306 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_export_assets_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportAssets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_ExportAssets_sync] +from google.cloud import asset_v1 + + +def sample_export_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + output_config = asset_v1.OutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1.ExportAssetsRequest( + parent="parent_value", + output_config=output_config, + ) + + # Make the request + operation = client.export_assets(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_ExportAssets_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_get_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_get_feed_async.py new file mode 100644 index 000000000000..33c88d3b4b2a --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_get_feed_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_GetFeed_async] +from google.cloud import asset_v1 + + +async def sample_get_feed(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = await client.get_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_GetFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_get_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_get_feed_sync.py new file mode 100644 index 000000000000..98834ef0be65 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_get_feed_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_GetFeed_sync] +from google.cloud import asset_v1 + + +def sample_get_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = client.get_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_GetFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_assets_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_assets_async.py new file mode 100644 index 000000000000..0a6a0b4a098d --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_assets_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAssets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_ListAssets_async] +from google.cloud import asset_v1 + + +async def sample_list_assets(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + async for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_ListAssets_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_assets_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_assets_sync.py new file mode 100644 index 000000000000..5fad10b12adf --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_assets_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAssets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_ListAssets_sync] +from google.cloud import asset_v1 + + +def sample_list_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_ListAssets_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_async.py new file mode 100644 index 000000000000..8eec6bfab483 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListFeeds +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_ListFeeds_async] +from google.cloud import asset_v1 + + +async def sample_list_feeds(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = await client.list_feeds(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_ListFeeds_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_sync.py new file mode 100644 index 000000000000..7aba515f8bd3 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_list_feeds_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListFeeds +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_ListFeeds_sync] +from google.cloud import asset_v1 + + +def sample_list_feeds(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_feeds(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_ListFeeds_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_async.py new file mode 100644 index 000000000000..9be060836a2c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllIamPolicies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_SearchAllIamPolicies_async] +from google.cloud import asset_v1 + + +async def sample_search_all_iam_policies(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + async for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_SearchAllIamPolicies_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_sync.py new file mode 100644 index 000000000000..e39c08295ba9 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllIamPolicies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_SearchAllIamPolicies_sync] +from google.cloud import asset_v1 + + +def sample_search_all_iam_policies(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_SearchAllIamPolicies_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_resources_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_resources_async.py new file mode 100644 index 000000000000..aba043b4b80c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_resources_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllResources +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_SearchAllResources_async] +from google.cloud import asset_v1 + + +async def sample_search_all_resources(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + async for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_SearchAllResources_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_resources_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_resources_sync.py new file mode 100644 index 000000000000..475d8b4ad58d --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_search_all_resources_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllResources +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_SearchAllResources_sync] +from google.cloud import asset_v1 + + +def sample_search_all_resources(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_SearchAllResources_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_update_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_update_feed_async.py new file mode 100644 index 000000000000..e409b05b7182 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_update_feed_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_UpdateFeed_async] +from google.cloud import asset_v1 + + +async def sample_update_feed(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = await client.update_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_UpdateFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_update_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_update_feed_sync.py new file mode 100644 index 000000000000..214f4886f215 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1_asset_service_update_feed_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1_AssetService_UpdateFeed_sync] +from google.cloud import asset_v1 + + +def sample_update_feed(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1.Feed() + feed.name = "name_value" + + request = asset_v1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = client.update_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1_AssetService_UpdateFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_async.py new file mode 100644 index 000000000000..9a921581e3af --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllIamPolicies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllIamPolicies_async] +from google.cloud import asset_v1p1beta1 + + +async def sample_search_all_iam_policies(): + # Create a client + client = asset_v1p1beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + async for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllIamPolicies_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_sync.py new file mode 100644 index 000000000000..a60db86f2598 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllIamPolicies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllIamPolicies_sync] +from google.cloud import asset_v1p1beta1 + + +def sample_search_all_iam_policies(): + # Create a client + client = asset_v1p1beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllIamPoliciesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_iam_policies(request=request) + for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllIamPolicies_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_async.py new file mode 100644 index 000000000000..f9e4aa6f5bf2 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllResources +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllResources_async] +from google.cloud import asset_v1p1beta1 + + +async def sample_search_all_resources(): + # Create a client + client = asset_v1p1beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + async for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllResources_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_sync.py new file mode 100644 index 000000000000..5e1e2afb0d9b --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAllResources +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllResources_sync] +from google.cloud import asset_v1p1beta1 + + +def sample_search_all_resources(): + # Create a client + client = asset_v1p1beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p1beta1.SearchAllResourcesRequest( + scope="scope_value", + ) + + # Make the request + page_result = client.search_all_resources(request=request) + for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllResources_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_async.py new file mode 100644 index 000000000000..76c170007a91 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_CreateFeed_async] +from google.cloud import asset_v1p2beta1 + + +async def sample_create_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = await client.create_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_CreateFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_sync.py new file mode 100644 index 000000000000..7ad3a6672e66 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_CreateFeed_sync] +from google.cloud import asset_v1p2beta1 + + +def sample_create_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.CreateFeedRequest( + parent="parent_value", + feed_id="feed_id_value", + feed=feed, + ) + + # Make the request + response = client.create_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_CreateFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_async.py new file mode 100644 index 000000000000..a382ca424cf4 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_DeleteFeed_async] +from google.cloud import asset_v1p2beta1 + + +async def sample_delete_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = await client.delete_feed(request=request) + + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_DeleteFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_sync.py new file mode 100644 index 000000000000..8d4eb12361c0 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_DeleteFeed_sync] +from google.cloud import asset_v1p2beta1 + + +def sample_delete_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.DeleteFeedRequest( + name="name_value", + ) + + # Make the request + response = client.delete_feed(request=request) + + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_DeleteFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_async.py new file mode 100644 index 000000000000..0d6e77c1668d --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_GetFeed_async] +from google.cloud import asset_v1p2beta1 + + +async def sample_get_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = await client.get_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_GetFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_sync.py new file mode 100644 index 000000000000..85675ca550bd --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_GetFeed_sync] +from google.cloud import asset_v1p2beta1 + + +def sample_get_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.GetFeedRequest( + name="name_value", + ) + + # Make the request + response = client.get_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_GetFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_async.py new file mode 100644 index 000000000000..cd59d163c77f --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListFeeds +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_ListFeeds_async] +from google.cloud import asset_v1p2beta1 + + +async def sample_list_feeds(): + # Create a client + client = asset_v1p2beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = await client.list_feeds(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_ListFeeds_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_sync.py new file mode 100644 index 000000000000..aeec26d12cde --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListFeeds +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_ListFeeds_sync] +from google.cloud import asset_v1p2beta1 + + +def sample_list_feeds(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p2beta1.ListFeedsRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_feeds(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_ListFeeds_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_async.py new file mode 100644 index 000000000000..5eb68f7763ed --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_UpdateFeed_async] +from google.cloud import asset_v1p2beta1 + + +async def sample_update_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = await client.update_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_UpdateFeed_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_sync.py new file mode 100644 index 000000000000..35a9b0220de2 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFeed +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p2beta1_AssetService_UpdateFeed_sync] +from google.cloud import asset_v1p2beta1 + + +def sample_update_feed(): + # Create a client + client = asset_v1p2beta1.AssetServiceClient() + + # Initialize request argument(s) + feed = asset_v1p2beta1.Feed() + feed.name = "name_value" + + request = asset_v1p2beta1.UpdateFeedRequest( + feed=feed, + ) + + # Make the request + response = client.update_feed(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p2beta1_AssetService_UpdateFeed_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_async.py new file mode 100644 index 000000000000..1456349977b5 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p4beta1_AssetService_AnalyzeIamPolicy_async] +from google.cloud import asset_v1p4beta1 + + +async def sample_analyze_iam_policy(): + # Create a client + client = asset_v1p4beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + request = asset_v1p4beta1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = await client.analyze_iam_policy(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p4beta1_AssetService_AnalyzeIamPolicy_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_sync.py new file mode 100644 index 000000000000..038ff538bdd4 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p4beta1_AssetService_AnalyzeIamPolicy_sync] +from google.cloud import asset_v1p4beta1 + + +def sample_analyze_iam_policy(): + # Create a client + client = asset_v1p4beta1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + request = asset_v1p4beta1.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, + ) + + # Make the request + response = client.analyze_iam_policy(request=request) + + # Handle response + print(response) + +# [END cloudasset_generated_asset_v1p4beta1_AssetService_AnalyzeIamPolicy_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_async.py new file mode 100644 index 000000000000..bcd9193b5244 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportIamPolicyAnalysis +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p4beta1_AssetService_ExportIamPolicyAnalysis_async] +from google.cloud import asset_v1p4beta1 + + +async def sample_export_iam_policy_analysis(): + # Create a client + client = asset_v1p4beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + output_config = asset_v1p4beta1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1p4beta1.ExportIamPolicyAnalysisRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.export_iam_policy_analysis(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + print(response) + +# [END cloudasset_generated_asset_v1p4beta1_AssetService_ExportIamPolicyAnalysis_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_sync.py new file mode 100644 index 000000000000..892e6c866b88 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportIamPolicyAnalysis +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p4beta1_AssetService_ExportIamPolicyAnalysis_sync] +from google.cloud import asset_v1p4beta1 + + +def sample_export_iam_policy_analysis(): + # Create a client + client = asset_v1p4beta1.AssetServiceClient() + + # Initialize request argument(s) + analysis_query = asset_v1p4beta1.IamPolicyAnalysisQuery() + analysis_query.parent = "parent_value" + + output_config = asset_v1p4beta1.IamPolicyAnalysisOutputConfig() + output_config.gcs_destination.uri = "uri_value" + + request = asset_v1p4beta1.ExportIamPolicyAnalysisRequest( + analysis_query=analysis_query, + output_config=output_config, + ) + + # Make the request + operation = client.export_iam_policy_analysis(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + print(response) + +# [END cloudasset_generated_asset_v1p4beta1_AssetService_ExportIamPolicyAnalysis_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_async.py new file mode 100644 index 000000000000..f787254ba79c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAssets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p5beta1_AssetService_ListAssets_async] +from google.cloud import asset_v1p5beta1 + + +async def sample_list_assets(): + # Create a client + client = asset_v1p5beta1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1p5beta1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + async for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1p5beta1_AssetService_ListAssets_async] diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_sync.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_sync.py new file mode 100644 index 000000000000..6a80f403d4e5 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAssets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-asset + + +# [START cloudasset_generated_asset_v1p5beta1_AssetService_ListAssets_sync] +from google.cloud import asset_v1p5beta1 + + +def sample_list_assets(): + # Create a client + client = asset_v1p5beta1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1p5beta1.ListAssetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_assets(request=request) + for response in page_result: + print(response) + +# [END cloudasset_generated_asset_v1p5beta1_AssetService_ListAssets_sync] diff --git a/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1.json b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1.json new file mode 100644 index 000000000000..1b51e40a9d26 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1.json @@ -0,0 +1,1137 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeIamPolicyLongrunning" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeIamPolicyLongrunning" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeIamPolicy" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeIamPolicy" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeMove" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_analyze_move_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_AnalyzeMove_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeMove" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_analyze_move_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_AnalyzeMove_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "BatchGetAssetsHistory" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "BatchGetAssetsHistory" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "CreateFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_create_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_CreateFeed_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "CreateFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_create_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_CreateFeed_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "DeleteFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_delete_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_DeleteFeed_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "DeleteFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_delete_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_DeleteFeed_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ExportAssets" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_export_assets_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_ExportAssets_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ExportAssets" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_export_assets_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_ExportAssets_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "GetFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_get_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_GetFeed_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "GetFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_get_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_GetFeed_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListAssets" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_list_assets_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_ListAssets_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListAssets" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_list_assets_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_ListAssets_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListFeeds" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_list_feeds_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_ListFeeds_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListFeeds" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_list_feeds_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_ListFeeds_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllIamPolicies" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_SearchAllIamPolicies_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllIamPolicies" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_search_all_iam_policies_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_SearchAllIamPolicies_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllResources" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_search_all_resources_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_SearchAllResources_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllResources" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_search_all_resources_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_SearchAllResources_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "UpdateFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_update_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_UpdateFeed_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "UpdateFeed" + } + }, + "file": "cloudasset_generated_asset_v1_asset_service_update_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1_AssetService_UpdateFeed_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p1beta1.json b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p1beta1.json new file mode 100644 index 000000000000..14a3c62f8790 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p1beta1.json @@ -0,0 +1,174 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllIamPolicies" + } + }, + "file": "cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_async.py", + "regionTag": "cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllIamPolicies_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllIamPolicies" + } + }, + "file": "cloudasset_generated_asset_v1p1beta1_asset_service_search_all_iam_policies_sync.py", + "regionTag": "cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllIamPolicies_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllResources" + } + }, + "file": "cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_async.py", + "regionTag": "cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllResources_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "SearchAllResources" + } + }, + "file": "cloudasset_generated_asset_v1p1beta1_asset_service_search_all_resources_sync.py", + "regionTag": "cloudasset_generated_asset_v1p1beta1_AssetService_SearchAllResources_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p2beta1.json b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p2beta1.json new file mode 100644 index 000000000000..b4394ee1f558 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p2beta1.json @@ -0,0 +1,445 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "CreateFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_CreateFeed_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "CreateFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_create_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_CreateFeed_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "DeleteFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_DeleteFeed_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "DeleteFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_delete_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_DeleteFeed_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "GetFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_GetFeed_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "GetFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_get_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_GetFeed_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListFeeds" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_async.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_ListFeeds_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListFeeds" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_list_feeds_sync.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_ListFeeds_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "UpdateFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_async.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_UpdateFeed_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "UpdateFeed" + } + }, + "file": "cloudasset_generated_asset_v1p2beta1_asset_service_update_feed_sync.py", + "regionTag": "cloudasset_generated_asset_v1p2beta1_AssetService_UpdateFeed_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p4beta1.json b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p4beta1.json new file mode 100644 index 000000000000..85a9eedbb393 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p4beta1.json @@ -0,0 +1,178 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeIamPolicy" + } + }, + "file": "cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_async.py", + "regionTag": "cloudasset_generated_asset_v1p4beta1_AssetService_AnalyzeIamPolicy_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "AnalyzeIamPolicy" + } + }, + "file": "cloudasset_generated_asset_v1p4beta1_asset_service_analyze_iam_policy_sync.py", + "regionTag": "cloudasset_generated_asset_v1p4beta1_AssetService_AnalyzeIamPolicy_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 41, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 42, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ExportIamPolicyAnalysis" + } + }, + "file": "cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_async.py", + "regionTag": "cloudasset_generated_asset_v1p4beta1_AssetService_ExportIamPolicyAnalysis_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ExportIamPolicyAnalysis" + } + }, + "file": "cloudasset_generated_asset_v1p4beta1_asset_service_export_iam_policy_analysis_sync.py", + "regionTag": "cloudasset_generated_asset_v1p4beta1_AssetService_ExportIamPolicyAnalysis_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p5beta1.json b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p5beta1.json new file mode 100644 index 000000000000..3947141c6f19 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated_samples/snippet_metadata_asset_v1p5beta1.json @@ -0,0 +1,89 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListAssets" + } + }, + "file": "cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_async.py", + "regionTag": "cloudasset_generated_asset_v1p5beta1_AssetService_ListAssets_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "AssetService" + }, + "shortName": "ListAssets" + } + }, + "file": "cloudasset_generated_asset_v1p5beta1_asset_service_list_assets_sync.py", + "regionTag": "cloudasset_generated_asset_v1p5beta1_AssetService_ListAssets_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/packages/google-cloud-asset/samples/snippets/noxfile_config.py b/packages/google-cloud-asset/samples/snippets/noxfile_config.py index 4a4db8c2de30..5c3e8031a977 100644 --- a/packages/google-cloud-asset/samples/snippets/noxfile_config.py +++ b/packages/google-cloud-asset/samples/snippets/noxfile_config.py @@ -18,7 +18,7 @@ # the noxfile.py. # The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile_config.py TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions.