From a25f16a93fa10e65036bf593682d0ea91b123261 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:16:21 +0000 Subject: [PATCH] feat: [cloudasset] Add client library support for AssetService v1 SavedQuery APIs (#8426) - [ ] Regenerate this pull request now. Committer: jeffreyai@ PiperOrigin-RevId: 475366952 Source-Link: https://github.com/googleapis/googleapis/commit/7428dad9f642a1b74fe4c4a23efe2d84234ac27f Source-Link: https://github.com/googleapis/googleapis-gen/commit/5629e2ab728443a1a6abb03f34f925d5cd4e0c47 Copy-Tag: eyJwIjoiamF2YS1hc3NldC8uT3dsQm90LnlhbWwiLCJoIjoiNTYyOWUyYWI3Mjg0NDNhMWE2YWJiMDNmMzRmOTI1ZDVjZDRlMGM0NyJ9 --- java-asset/README.md | 61 +------------- .../v1/stub/AssetServiceStubSettings.java | 20 ++--- java-asset/renovate.json | 74 ++++++++++++++++ .../samples/install-without-bom/pom.xml | 84 +++++++++++++++++++ java-asset/samples/pom.xml | 56 +++++++++++++ java-asset/samples/snapshot/pom.xml | 83 ++++++++++++++++++ java-asset/samples/snippets/pom.xml | 47 +++++++++++ 7 files changed, 358 insertions(+), 67 deletions(-) create mode 100644 java-asset/renovate.json create mode 100644 java-asset/samples/install-without-bom/pom.xml create mode 100644 java-asset/samples/pom.xml create mode 100644 java-asset/samples/snapshot/pom.xml create mode 100644 java-asset/samples/snippets/pom.xml diff --git a/java-asset/README.md b/java-asset/README.md index a7970db87431..1fd0c9c1caa1 100644 --- a/java-asset/README.md +++ b/java-asset/README.md @@ -11,59 +11,28 @@ Java idiomatic client for [Cloud Asset Inventory][product-docs]. ## Quickstart -If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: -```xml - - - - com.google.cloud - libraries-bom - 26.1.1 - pom - import - - - - - - - com.google.cloud - google-cloud-asset - - - -``` - -If you are using Maven without BOM, add this to your dependencies: +If you are using Maven, add this to your pom.xml file: ```xml com.google.cloud google-cloud-asset - 3.5.0 + 3.6.0 - ``` -If you are using Gradle 5.x or later, add this to your dependencies: - -```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.1') - -implementation 'com.google.cloud:google-cloud-asset' -``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-asset:3.5.0' +implementation 'com.google.cloud:google-cloud-asset:3.6.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "3.5.0" +libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "3.6.0" ``` ## Authentication @@ -101,28 +70,6 @@ use this Cloud Asset Inventory Client Library. -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/java-asset/tree/main/samples) directory. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | -| 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) | - - ## Troubleshooting diff --git a/java-asset/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/java-asset/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index d469596b9268..c0a4ba15d1ef 100644 --- a/java-asset/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/java-asset/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -1050,28 +1050,28 @@ private static Builder initDefaults(Builder builder) { builder .createSavedQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getSavedQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listSavedQueriesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .updateSavedQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .deleteSavedQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .batchGetEffectiveIamPoliciesSettings() diff --git a/java-asset/renovate.json b/java-asset/renovate.json new file mode 100644 index 000000000000..b69db9d19fe6 --- /dev/null +++ b/java-asset/renovate.json @@ -0,0 +1,74 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-asset", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis", + "^com.google.cloud:google-cloud-conformance-tests" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "dependencyDashboard": true +} diff --git a/java-asset/samples/install-without-bom/pom.xml b/java-asset/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..5bdc7a82c2f8 --- /dev/null +++ b/java-asset/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + -install-without-bom + jar + Google Cloud Asset Inventory Install Without Bom + https://github.com/googleapis/java-asset + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-asset + 3.6.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-asset/samples/pom.xml b/java-asset/samples/pom.xml new file mode 100644 index 000000000000..0d93aa4e48a4 --- /dev/null +++ b/java-asset/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud--samples + 0.0.1-SNAPSHOT + pom + Google Cloud Asset Inventory Samples Parent + https://github.com/googleapis/java-asset + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + + true + + + + + diff --git a/java-asset/samples/snapshot/pom.xml b/java-asset/samples/snapshot/pom.xml new file mode 100644 index 000000000000..38568ea4bd87 --- /dev/null +++ b/java-asset/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + -snapshot + jar + Google Cloud Asset Inventory Snapshot Samples + https://github.com/googleapis/java-asset + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-asset + 3.6.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-asset/samples/snippets/pom.xml b/java-asset/samples/snippets/pom.xml new file mode 100644 index 000000000000..dc5e255cb3cd --- /dev/null +++ b/java-asset/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + -snippets + jar + Google Cloud Asset Inventory Snippets + https://github.com/googleapis/java-asset + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-asset + 3.6.0 + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + +