Skip to content

Commit a25f16a

Browse files
feat: [cloudasset] Add client library support for AssetService v1 SavedQuery APIs (#8426)
- [ ] Regenerate this pull request now. Committer: jeffreyai@ PiperOrigin-RevId: 475366952 Source-Link: googleapis/googleapis@7428dad Source-Link: https://github.com/googleapis/googleapis-gen/commit/5629e2ab728443a1a6abb03f34f925d5cd4e0c47 Copy-Tag: eyJwIjoiamF2YS1hc3NldC8uT3dsQm90LnlhbWwiLCJoIjoiNTYyOWUyYWI3Mjg0NDNhMWE2YWJiMDNmMzRmOTI1ZDVjZDRlMGM0NyJ9
1 parent 1b2c275 commit a25f16a

File tree

7 files changed

+358
-67
lines changed

7 files changed

+358
-67
lines changed

java-asset/README.md

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,28 @@ Java idiomatic client for [Cloud Asset Inventory][product-docs].
1111

1212
## Quickstart
1313

14-
If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
1514

16-
```xml
17-
<dependencyManagement>
18-
<dependencies>
19-
<dependency>
20-
<groupId>com.google.cloud</groupId>
21-
<artifactId>libraries-bom</artifactId>
22-
<version>26.1.1</version>
23-
<type>pom</type>
24-
<scope>import</scope>
25-
</dependency>
26-
</dependencies>
27-
</dependencyManagement>
28-
29-
<dependencies>
30-
<dependency>
31-
<groupId>com.google.cloud</groupId>
32-
<artifactId>google-cloud-asset</artifactId>
33-
</dependency>
34-
</dependencies>
35-
36-
```
37-
38-
If you are using Maven without BOM, add this to your dependencies:
15+
If you are using Maven, add this to your pom.xml file:
3916

4017

4118
```xml
4219
<dependency>
4320
<groupId>com.google.cloud</groupId>
4421
<artifactId>google-cloud-asset</artifactId>
45-
<version>3.5.0</version>
22+
<version>3.6.0</version>
4623
</dependency>
47-
4824
```
4925

50-
If you are using Gradle 5.x or later, add this to your dependencies:
51-
52-
```Groovy
53-
implementation platform('com.google.cloud:libraries-bom:26.1.1')
54-
55-
implementation 'com.google.cloud:google-cloud-asset'
56-
```
5726
If you are using Gradle without BOM, add this to your dependencies:
5827

5928
```Groovy
60-
implementation 'com.google.cloud:google-cloud-asset:3.5.0'
29+
implementation 'com.google.cloud:google-cloud-asset:3.6.0'
6130
```
6231

6332
If you are using SBT, add this to your dependencies:
6433

6534
```Scala
66-
libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "3.5.0"
35+
libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "3.6.0"
6736
```
6837

6938
## Authentication
@@ -101,28 +70,6 @@ use this Cloud Asset Inventory Client Library.
10170

10271

10372

104-
## Samples
105-
106-
Samples are in the [`samples/`](https://github.com/googleapis/java-asset/tree/main/samples) directory.
107-
108-
| Sample | Source Code | Try it |
109-
| --------------------------- | --------------------------------- | ------ |
110-
| Analyze Iam Policy Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/AnalyzeIamPolicyExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/AnalyzeIamPolicyExample.java) |
111-
| Analyze Iam Policy Longrunning Bigquery Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/AnalyzeIamPolicyLongrunningBigqueryExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/AnalyzeIamPolicyLongrunningBigqueryExample.java) |
112-
| Analyze Iam Policy Longrunning Gcs Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/AnalyzeIamPolicyLongrunningGcsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/AnalyzeIamPolicyLongrunningGcsExample.java) |
113-
| Batch Get Assets History Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java) |
114-
| Create Feed Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java) |
115-
| Delete Feed Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java) |
116-
| Export Assets Bigquery Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/ExportAssetsBigqueryExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ExportAssetsBigqueryExample.java) |
117-
| Export Assets Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/ExportAssetsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ExportAssetsExample.java) |
118-
| Get Feed Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/GetFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/GetFeedExample.java) |
119-
| List Assets Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java) |
120-
| List Feeds Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java) |
121-
| Search All Iam Policies Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/SearchAllIamPoliciesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/SearchAllIamPoliciesExample.java) |
122-
| Search All Resources Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java) |
123-
| Update Feed Example | [source code](https://github.com/googleapis/java-asset/blob/main/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java) |
124-
125-
12673

12774
## Troubleshooting
12875

java-asset/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,28 +1050,28 @@ private static Builder initDefaults(Builder builder) {
10501050

10511051
builder
10521052
.createSavedQuerySettings()
1053-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1054-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
1053+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
1054+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
10551055

10561056
builder
10571057
.getSavedQuerySettings()
1058-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1059-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
1058+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1059+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
10601060

10611061
builder
10621062
.listSavedQueriesSettings()
1063-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1064-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
1063+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1064+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
10651065

10661066
builder
10671067
.updateSavedQuerySettings()
1068-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1069-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
1068+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
1069+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
10701070

10711071
builder
10721072
.deleteSavedQuerySettings()
1073-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1074-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
1073+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1074+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
10751075

10761076
builder
10771077
.batchGetEffectiveIamPoliciesSettings()

java-asset/renovate.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"extends": [
3+
":separateMajorReleases",
4+
":combinePatchMinorReleases",
5+
":ignoreUnstable",
6+
":prImmediately",
7+
":updateNotScheduled",
8+
":automergeDisabled",
9+
":ignoreModulesAndTests",
10+
":maintainLockFilesDisabled",
11+
":autodetectPinVersions"
12+
],
13+
"packageRules": [
14+
{
15+
"packagePatterns": [
16+
"^com.google.guava:"
17+
],
18+
"versionScheme": "docker"
19+
},
20+
{
21+
"packagePatterns": [
22+
"*"
23+
],
24+
"semanticCommitType": "deps",
25+
"semanticCommitScope": null
26+
},
27+
{
28+
"packagePatterns": [
29+
"^org.apache.maven",
30+
"^org.jacoco:",
31+
"^org.codehaus.mojo:",
32+
"^org.sonatype.plugins:",
33+
"^com.coveo:",
34+
"^com.google.cloud:google-cloud-shared-config"
35+
],
36+
"semanticCommitType": "build",
37+
"semanticCommitScope": "deps"
38+
},
39+
{
40+
"packagePatterns": [
41+
"^com.google.cloud:google-cloud-asset",
42+
"^com.google.cloud:libraries-bom",
43+
"^com.google.cloud.samples:shared-configuration"
44+
],
45+
"semanticCommitType": "chore",
46+
"semanticCommitScope": "deps"
47+
},
48+
{
49+
"packagePatterns": [
50+
"^junit:junit",
51+
"^com.google.truth:truth",
52+
"^org.mockito:mockito-core",
53+
"^org.objenesis:objenesis",
54+
"^com.google.cloud:google-cloud-conformance-tests"
55+
],
56+
"semanticCommitType": "test",
57+
"semanticCommitScope": "deps"
58+
},
59+
{
60+
"packagePatterns": [
61+
"^com.google.cloud:google-cloud-"
62+
],
63+
"ignoreUnstable": false
64+
},
65+
{
66+
"packagePatterns": [
67+
"^com.fasterxml.jackson.core"
68+
],
69+
"groupName": "jackson dependencies"
70+
}
71+
],
72+
"semanticCommits": true,
73+
"dependencyDashboard": true
74+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.google.cloud</groupId>
5+
<artifactId>-install-without-bom</artifactId>
6+
<packaging>jar</packaging>
7+
<name>Google Cloud Asset Inventory Install Without Bom</name>
8+
<url>https://github.com/googleapis/java-asset</url>
9+
10+
<!--
11+
The parent pom defines common style checks and testing strategies for our samples.
12+
Removing or replacing it should not affect the execution of the samples in anyway.
13+
-->
14+
<parent>
15+
<groupId>com.google.cloud.samples</groupId>
16+
<artifactId>shared-configuration</artifactId>
17+
<version>1.2.0</version>
18+
</parent>
19+
20+
<properties>
21+
<maven.compiler.target>1.8</maven.compiler.target>
22+
<maven.compiler.source>1.8</maven.compiler.source>
23+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24+
</properties>
25+
26+
27+
<dependencies>
28+
<!-- [START _install_without_bom] -->
29+
<dependency>
30+
<groupId>com.google.cloud</groupId>
31+
<artifactId>google-cloud-asset</artifactId>
32+
<version>3.6.0</version>
33+
</dependency>
34+
<!-- [END _install_without_bom] -->
35+
36+
<dependency>
37+
<groupId>junit</groupId>
38+
<artifactId>junit</artifactId>
39+
<version>4.13.2</version>
40+
<scope>test</scope>
41+
</dependency>
42+
<dependency>
43+
<groupId>com.google.truth</groupId>
44+
<artifactId>truth</artifactId>
45+
<version>1.1.3</version>
46+
<scope>test</scope>
47+
</dependency>
48+
</dependencies>
49+
50+
<!-- compile and run all snippet tests -->
51+
<build>
52+
<plugins>
53+
<plugin>
54+
<groupId>org.codehaus.mojo</groupId>
55+
<artifactId>build-helper-maven-plugin</artifactId>
56+
<version>3.3.0</version>
57+
<executions>
58+
<execution>
59+
<id>add-snippets-source</id>
60+
<goals>
61+
<goal>add-source</goal>
62+
</goals>
63+
<configuration>
64+
<sources>
65+
<source>../snippets/src/main/java</source>
66+
</sources>
67+
</configuration>
68+
</execution>
69+
<execution>
70+
<id>add-snippets-tests</id>
71+
<goals>
72+
<goal>add-test-source</goal>
73+
</goals>
74+
<configuration>
75+
<sources>
76+
<source>../snippets/src/test/java</source>
77+
</sources>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
</project>

java-asset/samples/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.google.cloud</groupId>
5+
<artifactId>google-cloud--samples</artifactId>
6+
<version>0.0.1-SNAPSHOT</version><!-- This artifact should not be released -->
7+
<packaging>pom</packaging>
8+
<name>Google Cloud Asset Inventory Samples Parent</name>
9+
<url>https://github.com/googleapis/java-asset</url>
10+
<description>
11+
Java idiomatic client for Google Cloud Platform services.
12+
</description>
13+
14+
<!--
15+
The parent pom defines common style checks and testing strategies for our samples.
16+
Removing or replacing it should not affect the execution of the samples in any way.
17+
-->
18+
<parent>
19+
<groupId>com.google.cloud.samples</groupId>
20+
<artifactId>shared-configuration</artifactId>
21+
<version>1.2.0</version>
22+
</parent>
23+
24+
<properties>
25+
<maven.compiler.target>1.8</maven.compiler.target>
26+
<maven.compiler.source>1.8</maven.compiler.source>
27+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
28+
</properties>
29+
30+
<modules>
31+
<module>install-without-bom</module>
32+
<module>snapshot</module>
33+
<module>snippets</module>
34+
</modules>
35+
36+
<build>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-deploy-plugin</artifactId>
41+
<version>2.8.2</version>
42+
<configuration>
43+
<skip>true</skip>
44+
</configuration>
45+
</plugin>
46+
<plugin>
47+
<groupId>org.sonatype.plugins</groupId>
48+
<artifactId>nexus-staging-maven-plugin</artifactId>
49+
<version>1.6.13</version>
50+
<configuration>
51+
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
52+
</configuration>
53+
</plugin>
54+
</plugins>
55+
</build>
56+
</project>

0 commit comments

Comments
 (0)