From de947a1f057c0f760aac860103c2c940efabb4de Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 07:36:41 -0400 Subject: [PATCH] feat: Release of query system (#467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Release of query system Committer: lvv@ PiperOrigin-RevId: 466748663 Source-Link: https://github.com/googleapis/googleapis/commit/80d630f734c00f627511254d696149d9e0d7b635 Source-Link: https://github.com/googleapis/googleapis-gen/commit/252f5ade18a31a72f12810bbfd1d83d56a8e72e1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjUyZjVhZGUxOGEzMWE3MmYxMjgxMGJiZmQxZDgzZDU2YThlNzJlMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * set coverage level to 99% * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- ...erated_asset_service_query_assets_async.py | 46 ++++++ ...nerated_asset_service_query_assets_sync.py | 46 ++++++ .../snippet_metadata_asset_v1.json | 153 ++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py create mode 100644 asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py diff --git a/asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py b/asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py new file mode 100644 index 000000000000..3806695b8ea5 --- /dev/null +++ b/asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 QueryAssets +# 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_v1_generated_AssetService_QueryAssets_async] +from google.cloud import asset_v1 + + +async def sample_query_assets(): + # Create a client + client = asset_v1.AssetServiceAsyncClient() + + # Initialize request argument(s) + request = asset_v1.QueryAssetsRequest( + statement="statement_value", + parent="parent_value", + ) + + # Make the request + response = await client.query_assets(request=request) + + # Handle the response + print(response) + +# [END cloudasset_v1_generated_AssetService_QueryAssets_async] diff --git a/asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py b/asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py new file mode 100644 index 000000000000..73e5dee729ad --- /dev/null +++ b/asset/snippets/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 QueryAssets +# 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_v1_generated_AssetService_QueryAssets_sync] +from google.cloud import asset_v1 + + +def sample_query_assets(): + # Create a client + client = asset_v1.AssetServiceClient() + + # Initialize request argument(s) + request = asset_v1.QueryAssetsRequest( + statement="statement_value", + parent="parent_value", + ) + + # Make the request + response = client.query_assets(request=request) + + # Handle the response + print(response) + +# [END cloudasset_v1_generated_AssetService_QueryAssets_sync] diff --git a/asset/snippets/generated_samples/snippet_metadata_asset_v1.json b/asset/snippets/generated_samples/snippet_metadata_asset_v1.json index 239016ebc896..38bdf7215e2f 100644 --- a/asset/snippets/generated_samples/snippet_metadata_asset_v1.json +++ b/asset/snippets/generated_samples/snippet_metadata_asset_v1.json @@ -2381,6 +2381,159 @@ ], "title": "cloudasset_v1_generated_asset_service_list_saved_queries_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.asset_v1.AssetServiceAsyncClient", + "shortName": "AssetServiceAsyncClient" + }, + "fullName": "google.cloud.asset_v1.AssetServiceAsyncClient.query_assets", + "method": { + "fullName": "google.cloud.asset.v1.AssetService.QueryAssets", + "service": { + "fullName": "google.cloud.asset.v1.AssetService", + "shortName": "AssetService" + }, + "shortName": "QueryAssets" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.asset_v1.types.QueryAssetsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.asset_v1.types.QueryAssetsResponse", + "shortName": "query_assets" + }, + "description": "Sample for QueryAssets", + "file": "cloudasset_v1_generated_asset_service_query_assets_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudasset_v1_generated_AssetService_QueryAssets_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" + } + ], + "title": "cloudasset_v1_generated_asset_service_query_assets_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.asset_v1.AssetServiceClient", + "shortName": "AssetServiceClient" + }, + "fullName": "google.cloud.asset_v1.AssetServiceClient.query_assets", + "method": { + "fullName": "google.cloud.asset.v1.AssetService.QueryAssets", + "service": { + "fullName": "google.cloud.asset.v1.AssetService", + "shortName": "AssetService" + }, + "shortName": "QueryAssets" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.asset_v1.types.QueryAssetsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.asset_v1.types.QueryAssetsResponse", + "shortName": "query_assets" + }, + "description": "Sample for QueryAssets", + "file": "cloudasset_v1_generated_asset_service_query_assets_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudasset_v1_generated_AssetService_QueryAssets_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" + } + ], + "title": "cloudasset_v1_generated_asset_service_query_assets_sync.py" + }, { "canonical": true, "clientMethod": {