Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.63.1 (#365)
Browse files Browse the repository at this point in the history
- [x] Regenerate this pull request now.

docs: add autogenerated code snippets
PiperOrigin-RevId: 426256923

Source-Link: googleapis/googleapis@9ebabfa

Source-Link: googleapis/googleapis-gen@a881752
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTg4MTc1MjYzZTYwYTFkNDVkM2E0NDc4NDg2NTJiMGY2NzBiMmNiOCJ9

Closes: #285
  • Loading branch information
gcf-owl-bot[bot] authored Feb 5, 2022
1 parent e1c8fdc commit 4921fca
Show file tree
Hide file tree
Showing 62 changed files with 5,169 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 4921fca

Please sign in to comment.