Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
CloudAsset: Update asset lib to v1 for ListAssets sample code (#760)
Browse files Browse the repository at this point in the history
* CloudAsset: Update asset lib to v1 for ListAssets sample code

* 馃 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Neenu Shaji <Neenu1995@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 9, 2021
1 parent de859d8 commit e51e45c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -16,16 +16,16 @@

package com.example.asset;

// [START asset_quickstart_list_assets]
// Imports the Google Cloud client library

import com.google.cloud.asset.v1.AssetServiceClient;
import com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse;
import com.google.cloud.asset.v1.ContentType;
import com.google.cloud.asset.v1.ListAssetsRequest;
import com.google.cloud.asset.v1.ProjectName;
import com.google.cloud.asset.v1p5beta1.AssetServiceClient;
import com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse;
import com.google.cloud.asset.v1p5beta1.ContentType;
import com.google.cloud.asset.v1p5beta1.ListAssetsRequest;
import java.util.Arrays;

// [START asset_quickstart_list_assets]
// Imports the Google Cloud client library

public class ListAssetsExample {

public static void listAssets() throws Exception {
Expand All @@ -38,7 +38,7 @@ public static void listAssets() throws Exception {
String[] assetTypes = {"YOUR_ASSET_TYPES_TO_LIST"};
// The asset content type to list. E.g., ContentType.CONTENT_TYPE_UNSPECIFIED.
// See full list of content types at
// https://cloud.google.com/asset-inventory/docs/reference/rpc/google.cloud.asset.v1p5beta1#contenttype
// https://cloud.google.com/asset-inventory/docs/reference/rpc/google.cloud.asset.v1#contenttype
ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED;
listAssets(projectId, assetTypes, contentType);
}
Expand Down
Expand Up @@ -19,7 +19,7 @@
import static com.google.common.truth.Truth.assertThat;

import com.google.cloud.ServiceOptions;
import com.google.cloud.asset.v1p5beta1.ContentType;
import com.google.cloud.asset.v1.ContentType;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.After;
Expand Down

0 comments on commit e51e45c

Please sign in to comment.