-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: samplegen always produces sample dicts with "response" (#914)
- fix samplegen logic to always set a `sample[response]` - enable `autogen-snippets` for the golden integration tests that are run through Bazel - install some extra stub packages for mypy that are needed with the new release
- Loading branch information
1 parent
5225b67
commit 0b168f2
Showing
72 changed files
with
2,826 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../generated_samples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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_grpc] | ||
from google.cloud import asset_v1 | ||
|
||
|
||
def sample_analyze_iam_policy(): | ||
"""Snippet for analyze_iam_policy""" | ||
|
||
# Create a client | ||
client = asset_v1.AssetServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = asset_v1.AnalyzeIamPolicyRequest( | ||
) | ||
|
||
# Make the request | ||
response = client.analyze_iam_policy(request=request) | ||
|
||
# Handle response | ||
print("{}".format(response)) | ||
|
||
# [END cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicy_grpc] |
48 changes: 48 additions & 0 deletions
48
...amples/cloudasset_generated_asset_v1_asset_service_analyze_iam_policy_longrunning_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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_grpc] | ||
from google.cloud import asset_v1 | ||
|
||
|
||
def sample_analyze_iam_policy_longrunning(): | ||
"""Snippet for analyze_iam_policy_longrunning""" | ||
|
||
# Create a client | ||
client = asset_v1.AssetServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = asset_v1.AnalyzeIamPolicyLongrunningRequest( | ||
) | ||
|
||
# Make the request | ||
operation = client.analyze_iam_policy_longrunning(request=request) | ||
|
||
print("Waiting for operation to complete...") | ||
|
||
response = operation.result() | ||
print("{}".format(response)) | ||
|
||
# [END cloudasset_generated_asset_v1_AssetService_AnalyzeIamPolicyLongrunning_grpc] |
46 changes: 46 additions & 0 deletions
46
...ated_samples/cloudasset_generated_asset_v1_asset_service_batch_get_assets_history_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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_grpc] | ||
from google.cloud import asset_v1 | ||
|
||
|
||
def sample_batch_get_assets_history(): | ||
"""Snippet for batch_get_assets_history""" | ||
|
||
# Create a client | ||
client = asset_v1.AssetServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = asset_v1.BatchGetAssetsHistoryRequest( | ||
) | ||
|
||
# Make the request | ||
response = client.batch_get_assets_history(request=request) | ||
|
||
# Handle response | ||
print("{}".format(response)) | ||
|
||
# [END cloudasset_generated_asset_v1_AssetService_BatchGetAssetsHistory_grpc] |
46 changes: 46 additions & 0 deletions
46
...samples/generated_samples/cloudasset_generated_asset_v1_asset_service_create_feed_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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_grpc] | ||
from google.cloud import asset_v1 | ||
|
||
|
||
def sample_create_feed(): | ||
"""Snippet for create_feed""" | ||
|
||
# Create a client | ||
client = asset_v1.AssetServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = asset_v1.CreateFeedRequest( | ||
) | ||
|
||
# Make the request | ||
response = client.create_feed(request=request) | ||
|
||
# Handle response | ||
print("{}".format(response)) | ||
|
||
# [END cloudasset_generated_asset_v1_AssetService_CreateFeed_grpc] |
44 changes: 44 additions & 0 deletions
44
...samples/generated_samples/cloudasset_generated_asset_v1_asset_service_delete_feed_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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_grpc] | ||
from google.cloud import asset_v1 | ||
|
||
|
||
def sample_delete_feed(): | ||
"""Snippet for delete_feed""" | ||
|
||
# Create a client | ||
client = asset_v1.AssetServiceClient() | ||
|
||
# Initialize request argument(s) | ||
request = asset_v1.DeleteFeedRequest( | ||
) | ||
|
||
# Make the request | ||
response = client.delete_feed(request=request) | ||
|
||
|
||
# [END cloudasset_generated_asset_v1_AssetService_DeleteFeed_grpc] |
Oops, something went wrong.