Skip to content

Commit e96234a

Browse files
feat: Add SavedQuery CURD support (#425)
- [ ] Regenerate this pull request now. feat: Add tags support feat: Add RelatedAsset and deprecate RelatedAssets for relationship GA *The previous representation of the relationship feature is deprecated and unimplemented. The RelatedAsset message represents the new stable format. PiperOrigin-RevId: 449306805 Source-Link: googleapis/googleapis@3d7bd9d Source-Link: https://github.com/googleapis/googleapis-gen/commit/71a93d05d6076271d04b7592f7fad0d3f0c7a040 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzFhOTNkMDVkNjA3NjI3MWQwNGI3NTkyZjdmYWQwZDNmMGM3YTA0MCJ9
1 parent 06e0e2f commit e96234a

13 files changed

+1695
-179
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchGetEffectiveIamPolicies
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async]
27+
from google.cloud import asset_v1
28+
29+
30+
async def sample_batch_get_effective_iam_policies():
31+
# Create a client
32+
client = asset_v1.AssetServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.BatchGetEffectiveIamPoliciesRequest(
36+
scope="scope_value",
37+
names=['names_value_1', 'names_value_2'],
38+
)
39+
40+
# Make the request
41+
response = await client.batch_get_effective_iam_policies(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchGetEffectiveIamPolicies
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync]
27+
from google.cloud import asset_v1
28+
29+
30+
def sample_batch_get_effective_iam_policies():
31+
# Create a client
32+
client = asset_v1.AssetServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.BatchGetEffectiveIamPoliciesRequest(
36+
scope="scope_value",
37+
names=['names_value_1', 'names_value_2'],
38+
)
39+
40+
# Make the request
41+
response = client.batch_get_effective_iam_policies(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateSavedQuery
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_CreateSavedQuery_async]
27+
from google.cloud import asset_v1
28+
29+
30+
async def sample_create_saved_query():
31+
# Create a client
32+
client = asset_v1.AssetServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.CreateSavedQueryRequest(
36+
parent="parent_value",
37+
saved_query_id="saved_query_id_value",
38+
)
39+
40+
# Make the request
41+
response = await client.create_saved_query(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END cloudasset_v1_generated_AssetService_CreateSavedQuery_async]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateSavedQuery
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_CreateSavedQuery_sync]
27+
from google.cloud import asset_v1
28+
29+
30+
def sample_create_saved_query():
31+
# Create a client
32+
client = asset_v1.AssetServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.CreateSavedQueryRequest(
36+
parent="parent_value",
37+
saved_query_id="saved_query_id_value",
38+
)
39+
40+
# Make the request
41+
response = client.create_saved_query(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END cloudasset_v1_generated_AssetService_CreateSavedQuery_sync]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for DeleteSavedQuery
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_async]
27+
from google.cloud import asset_v1
28+
29+
30+
async def sample_delete_saved_query():
31+
# Create a client
32+
client = asset_v1.AssetServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.DeleteSavedQueryRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
await client.delete_saved_query(request=request)
41+
42+
43+
# [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_async]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for DeleteSavedQuery
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync]
27+
from google.cloud import asset_v1
28+
29+
30+
def sample_delete_saved_query():
31+
# Create a client
32+
client = asset_v1.AssetServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.DeleteSavedQueryRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
client.delete_saved_query(request=request)
41+
42+
43+
# [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for GetSavedQuery
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_GetSavedQuery_async]
27+
from google.cloud import asset_v1
28+
29+
30+
async def sample_get_saved_query():
31+
# Create a client
32+
client = asset_v1.AssetServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.GetSavedQueryRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
response = await client.get_saved_query(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END cloudasset_v1_generated_AssetService_GetSavedQuery_async]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for GetSavedQuery
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-asset
24+
25+
26+
# [START cloudasset_v1_generated_AssetService_GetSavedQuery_sync]
27+
from google.cloud import asset_v1
28+
29+
30+
def sample_get_saved_query():
31+
# Create a client
32+
client = asset_v1.AssetServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = asset_v1.GetSavedQueryRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
response = client.get_saved_query(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END cloudasset_v1_generated_AssetService_GetSavedQuery_sync]

0 commit comments

Comments
 (0)