From 76686501c521971cbeb524a5486ed2196283d276 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 15 Dec 2020 09:12:19 +0000 Subject: [PATCH 01/22] chore: release 2.2.2-SNAPSHOT (#485) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- google-cloud-asset-bom/pom.xml | 28 +++++++++++----------- google-cloud-asset/pom.xml | 4 ++-- grpc-google-cloud-asset-v1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p1beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p2beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p4beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p5beta1/pom.xml | 4 ++-- pom.xml | 28 +++++++++++----------- proto-google-cloud-asset-v1/pom.xml | 4 ++-- proto-google-cloud-asset-v1beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p1beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p2beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p4beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p5beta1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 26 ++++++++++---------- 17 files changed, 68 insertions(+), 68 deletions(-) diff --git a/google-cloud-asset-bom/pom.xml b/google-cloud-asset-bom/pom.xml index 1be72b92b..e2e0356f8 100644 --- a/google-cloud-asset-bom/pom.xml +++ b/google-cloud-asset-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-asset-bom - 2.2.1 + 2.2.2-SNAPSHOT pom com.google.cloud @@ -64,67 +64,67 @@ com.google.api.grpc proto-google-cloud-asset-v1 - 2.2.1 + 2.2.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1 - 2.2.1 + 2.2.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p2beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p4beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p5beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p2beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p4beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p5beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.cloud google-cloud-asset - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/google-cloud-asset/pom.xml b/google-cloud-asset/pom.xml index 2c8d34094..1fa168e77 100644 --- a/google-cloud-asset/pom.xml +++ b/google-cloud-asset/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-asset - 2.2.1 + 2.2.2-SNAPSHOT jar Google Cloud Asset https://github.com/googleapis/java-asset @@ -11,7 +11,7 @@ com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT google-cloud-asset diff --git a/grpc-google-cloud-asset-v1/pom.xml b/grpc-google-cloud-asset-v1/pom.xml index eadede9b7..09128bcc9 100644 --- a/grpc-google-cloud-asset-v1/pom.xml +++ b/grpc-google-cloud-asset-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1 - 2.2.1 + 2.2.2-SNAPSHOT grpc-google-cloud-asset-v1 GRPC library for grpc-google-cloud-asset-v1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/grpc-google-cloud-asset-v1beta1/pom.xml b/grpc-google-cloud-asset-v1beta1/pom.xml index 7e807b5af..68e55da7b 100644 --- a/grpc-google-cloud-asset-v1beta1/pom.xml +++ b/grpc-google-cloud-asset-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1beta1 - 0.95.1 + 0.95.2-SNAPSHOT grpc-google-cloud-asset-v1beta1 GRPC library for grpc-google-cloud-asset-v1beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/grpc-google-cloud-asset-v1p1beta1/pom.xml b/grpc-google-cloud-asset-v1p1beta1/pom.xml index 2e7d48f54..2039707b0 100644 --- a/grpc-google-cloud-asset-v1p1beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p1beta1 - 0.95.1 + 0.95.2-SNAPSHOT grpc-google-cloud-asset-v1p1beta1 GRPC library for grpc-google-cloud-asset-v1p1beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/grpc-google-cloud-asset-v1p2beta1/pom.xml b/grpc-google-cloud-asset-v1p2beta1/pom.xml index 7931f7610..441ad31c3 100644 --- a/grpc-google-cloud-asset-v1p2beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p2beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p2beta1 - 0.95.1 + 0.95.2-SNAPSHOT grpc-google-cloud-asset-v1p2beta1 GRPC library for grpc-google-cloud-asset-v1p2beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/grpc-google-cloud-asset-v1p4beta1/pom.xml b/grpc-google-cloud-asset-v1p4beta1/pom.xml index 1bd879732..67c6e08a6 100644 --- a/grpc-google-cloud-asset-v1p4beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p4beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p4beta1 - 0.95.1 + 0.95.2-SNAPSHOT grpc-google-cloud-asset-v1p4beta1 GRPC library for grpc-google-cloud-asset-v1p4beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/grpc-google-cloud-asset-v1p5beta1/pom.xml b/grpc-google-cloud-asset-v1p5beta1/pom.xml index 60bb246a7..b6c480555 100644 --- a/grpc-google-cloud-asset-v1p5beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p5beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p5beta1 - 0.95.1 + 0.95.2-SNAPSHOT grpc-google-cloud-asset-v1p5beta1 GRPC library for grpc-google-cloud-asset-v1p5beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index 3938c1579..03e889b5a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-asset-parent pom - 2.2.1 + 2.2.2-SNAPSHOT Google Cloud Asset Parent https://github.com/googleapis/java-asset @@ -70,67 +70,67 @@ com.google.api.grpc proto-google-cloud-asset-v1 - 2.2.1 + 2.2.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p2beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p4beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc proto-google-cloud-asset-v1p5beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1 - 2.2.1 + 2.2.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p1beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p2beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p4beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-asset-v1p5beta1 - 0.95.1 + 0.95.2-SNAPSHOT com.google.cloud google-cloud-asset - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/proto-google-cloud-asset-v1/pom.xml b/proto-google-cloud-asset-v1/pom.xml index ecbca083d..965febb76 100644 --- a/proto-google-cloud-asset-v1/pom.xml +++ b/proto-google-cloud-asset-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1 - 2.2.1 + 2.2.2-SNAPSHOT proto-google-cloud-asset-v1 PROTO library for proto-google-cloud-asset-v1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/proto-google-cloud-asset-v1beta1/pom.xml b/proto-google-cloud-asset-v1beta1/pom.xml index c8d634dbc..1babbee47 100644 --- a/proto-google-cloud-asset-v1beta1/pom.xml +++ b/proto-google-cloud-asset-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1beta1 - 0.95.1 + 0.95.2-SNAPSHOT proto-google-cloud-asset-v1beta1 PROTO library for proto-google-cloud-asset-v1beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/proto-google-cloud-asset-v1p1beta1/pom.xml b/proto-google-cloud-asset-v1p1beta1/pom.xml index 852ea6998..8b273cb20 100644 --- a/proto-google-cloud-asset-v1p1beta1/pom.xml +++ b/proto-google-cloud-asset-v1p1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p1beta1 - 0.95.1 + 0.95.2-SNAPSHOT proto-google-cloud-asset-v1p1beta1 PROTO library for proto-google-cloud-asset-v1p1beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/proto-google-cloud-asset-v1p2beta1/pom.xml b/proto-google-cloud-asset-v1p2beta1/pom.xml index 26f4bb8b8..e4b5009cd 100644 --- a/proto-google-cloud-asset-v1p2beta1/pom.xml +++ b/proto-google-cloud-asset-v1p2beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p2beta1 - 0.95.1 + 0.95.2-SNAPSHOT proto-google-cloud-asset-v1p2beta1 PROTO library for proto-google-cloud-asset-v1p2beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/proto-google-cloud-asset-v1p4beta1/pom.xml b/proto-google-cloud-asset-v1p4beta1/pom.xml index e8e487c52..68ca8e6aa 100644 --- a/proto-google-cloud-asset-v1p4beta1/pom.xml +++ b/proto-google-cloud-asset-v1p4beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p4beta1 - 0.95.1 + 0.95.2-SNAPSHOT proto-google-cloud-asset-v1p4beta1 PROTO library for proto-google-cloud-asset-v1p4beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/proto-google-cloud-asset-v1p5beta1/pom.xml b/proto-google-cloud-asset-v1p5beta1/pom.xml index 131f9d1aa..3173c0d73 100644 --- a/proto-google-cloud-asset-v1p5beta1/pom.xml +++ b/proto-google-cloud-asset-v1p5beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p5beta1 - 0.95.1 + 0.95.2-SNAPSHOT proto-google-cloud-asset-v1p5beta1 PROTO library for proto-google-cloud-asset-v1p4beta1 com.google.cloud google-cloud-asset-parent - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f0c0b3f50..73a1e27d1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-asset - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index ce0f6e0b6..c45a167c8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,16 +1,16 @@ # Format: # module:released-version:current-version -proto-google-cloud-asset-v1:2.2.1:2.2.1 -proto-google-cloud-asset-v1p1beta1:0.95.1:0.95.1 -proto-google-cloud-asset-v1p2beta1:0.95.1:0.95.1 -proto-google-cloud-asset-v1beta1:0.95.1:0.95.1 -proto-google-cloud-asset-v1p4beta1:0.95.1:0.95.1 -proto-google-cloud-asset-v1p5beta1:0.95.1:0.95.1 -grpc-google-cloud-asset-v1:2.2.1:2.2.1 -grpc-google-cloud-asset-v1beta1:0.95.1:0.95.1 -grpc-google-cloud-asset-v1p1beta1:0.95.1:0.95.1 -grpc-google-cloud-asset-v1p2beta1:0.95.1:0.95.1 -grpc-google-cloud-asset-v1p4beta1:0.95.1:0.95.1 -grpc-google-cloud-asset-v1p5beta1:0.95.1:0.95.1 -google-cloud-asset:2.2.1:2.2.1 \ No newline at end of file +proto-google-cloud-asset-v1:2.2.1:2.2.2-SNAPSHOT +proto-google-cloud-asset-v1p1beta1:0.95.1:0.95.2-SNAPSHOT +proto-google-cloud-asset-v1p2beta1:0.95.1:0.95.2-SNAPSHOT +proto-google-cloud-asset-v1beta1:0.95.1:0.95.2-SNAPSHOT +proto-google-cloud-asset-v1p4beta1:0.95.1:0.95.2-SNAPSHOT +proto-google-cloud-asset-v1p5beta1:0.95.1:0.95.2-SNAPSHOT +grpc-google-cloud-asset-v1:2.2.1:2.2.2-SNAPSHOT +grpc-google-cloud-asset-v1beta1:0.95.1:0.95.2-SNAPSHOT +grpc-google-cloud-asset-v1p1beta1:0.95.1:0.95.2-SNAPSHOT +grpc-google-cloud-asset-v1p2beta1:0.95.1:0.95.2-SNAPSHOT +grpc-google-cloud-asset-v1p4beta1:0.95.1:0.95.2-SNAPSHOT +grpc-google-cloud-asset-v1p5beta1:0.95.1:0.95.2-SNAPSHOT +google-cloud-asset:2.2.1:2.2.2-SNAPSHOT \ No newline at end of file From 439daca0bc021215809d7a3a27611046c37c6e6f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Dec 2020 19:30:13 +0100 Subject: [PATCH 02/22] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 (#487) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | minor | `0.16.1` -> `0.17.0` | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v0.17.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​0170-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare0161v0170-2020-12-15) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v0.16.1...v0.17.0) ##### Dependencies - update dependency com.google.guava:guava-bom to v30.1-android ([#​236](https://www.github.com/googleapis/java-shared-dependencies/issues/236)) ([78ebf7f](https://www.github.com/googleapis/java-shared-dependencies/commit/78ebf7fcec3ec0308ccd5103b719f02dde7ec6d8)) - update dependency io.grpc:grpc-bom to v1.34.1 ([#​238](https://www.github.com/googleapis/java-shared-dependencies/issues/238)) ([ee7e020](https://www.github.com/googleapis/java-shared-dependencies/commit/ee7e020a4631f2b288d1c6f5d681423d156e3c2d)) - update iam.version to v1.0.5 ([#​237](https://www.github.com/googleapis/java-shared-dependencies/issues/237)) ([bbe6be6](https://www.github.com/googleapis/java-shared-dependencies/commit/bbe6be650a93cf365f2439ae9c8bebf2ade83ddd)) ##### [0.16.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.16.0...v0.16.1) (2020-12-14) ##### Dependencies - rollback gRPC to 1.33.1 ([#​234](https://www.github.com/googleapis/java-shared-dependencies/issues/234)) ([67cc384](https://www.github.com/googleapis/java-shared-dependencies/commit/67cc384bacab8592d5bbc92db2469affee473eb7)) - update dependency com.google.auth:google-auth-library-bom to v0.22.1 ([#​229](https://www.github.com/googleapis/java-shared-dependencies/issues/229)) ([1c13161](https://www.github.com/googleapis/java-shared-dependencies/commit/1c13161fa289cd5f3923f389fd5b14f3b7b4a84d)) - update dependency com.google.auth:google-auth-library-bom to v0.22.2 ([#​235](https://www.github.com/googleapis/java-shared-dependencies/issues/235)) ([67434eb](https://www.github.com/googleapis/java-shared-dependencies/commit/67434eb4bb0789abcabb3055155672b2c2e70125)) - update iam.version to v1.0.4 ([#​231](https://www.github.com/googleapis/java-shared-dependencies/issues/231)) ([5edf99e](https://www.github.com/googleapis/java-shared-dependencies/commit/5edf99e0149a1b70eb52b8921e9eb04fb84d9160))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 03e889b5a..48a0c990d 100644 --- a/pom.xml +++ b/pom.xml @@ -136,7 +136,7 @@ com.google.cloud google-cloud-shared-dependencies - 0.16.1 + 0.17.0 pom import From 180a4ab37307a4e10487b9468e360faf3961d468 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Dec 2020 23:32:39 +0100 Subject: [PATCH 03/22] chore(deps): update dependency com.google.cloud:libraries-bom to v16.2.0 (#489) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | minor | `16.1.0` -> `16.2.0` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b23e5cadc..b5634b41f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -29,7 +29,7 @@ com.google.cloud libraries-bom - 16.1.0 + 16.2.0 pom import From 15092703c7959548f7a6c6ee42fd50eaef8cd28d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 15 Dec 2020 15:20:12 -0800 Subject: [PATCH 04/22] chore: regenerate README (#490) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2020-12-15 22:40:43,534 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-asset/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2020-12-15 22:40:44,408 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/1a2ceb1e-6e82-4fd8-8f9b-32a8775aebe8/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 08ee47ec3..d2d00638f 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-asset.git", - "sha": "c26e59fef7a24c39f50796204722b193c2bdefb4" + "sha": "180a4ab37307a4e10487b9468e360faf3961d468" } }, { diff --git a/README.md b/README.md index ad64fa62f..e17efbfe3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 16.1.0 + 16.2.0 pom import From 0d52720188fd521efc94492ccb89794826070b69 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 21 Dec 2020 10:22:02 -0800 Subject: [PATCH 05/22] feat: deprecate v1beta1 client endpoint is turned down (#493) Endpoint was turned down 2020-09-28 Fixes #481 --- .../asset/v1beta1/AssetServiceClient.java | 3 ++ .../asset/v1beta1/AssetServiceSettings.java | 3 ++ .../cloud/asset/v1beta1/package-info.java | 1 + .../asset/v1beta1/stub/AssetServiceStub.java | 3 ++ .../stub/AssetServiceStubSettings.java | 3 ++ .../stub/GrpcAssetServiceCallableFactory.java | 3 ++ .../v1beta1/stub/GrpcAssetServiceStub.java | 3 ++ .../cloud/asset/v1beta1/AssetServiceGrpc.java | 3 ++ synth.metadata | 45 ------------------- synth.py | 2 +- 10 files changed, 23 insertions(+), 46 deletions(-) diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java index 5fb3b776a..e1bb46b5d 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java @@ -96,7 +96,10 @@ * AssetServiceClient.create(assetServiceSettings); * * + * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @Generated("by gapic-generator") @BetaApi public class AssetServiceClient implements BackgroundResource { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java index 0c4a2bd9d..733ac7254 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java @@ -62,7 +62,10 @@ * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); * * + * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @Generated("by gapic-generator") @BetaApi public class AssetServiceSettings extends ClientSettings { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java index 2872d8126..99ea1b850 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java @@ -37,6 +37,7 @@ * * */ +@Deprecated @Generated("by gapic-generator") package com.google.cloud.asset.v1beta1; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java index e8e36a821..bac235ed0 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java @@ -32,7 +32,10 @@ * Base stub class for Cloud Asset API. * *

This class is for advanced usage and reflects the underlying API directly. + * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AssetServiceStub implements BackgroundResource { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java index e3ab77b21..961b01fab 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java @@ -78,7 +78,10 @@ * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); * * + * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @Generated("by gapic-generator") @BetaApi public class AssetServiceStubSettings extends StubSettings { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java index 4668c4b5b..7e234e579 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java @@ -39,7 +39,10 @@ * gRPC callable factory implementation for Cloud Asset API. * *

This class is for advanced usage. + * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @Generated("by gapic-generator") @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java index 4d8c66107..3c27cba6d 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java @@ -43,7 +43,10 @@ * gRPC stub implementation for Cloud Asset API. * *

This class is for advanced usage and reflects the underlying API directly. + * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @Generated("by gapic-generator") @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcAssetServiceStub extends AssetServiceStub { diff --git a/grpc-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java b/grpc-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java index 9bb587d31..4005e04cc 100644 --- a/grpc-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java +++ b/grpc-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java @@ -28,7 +28,10 @@ *

  * Asset service definition.
  * 
+ * + * @deprecated The v1beta1 endpoint was turned down 2020-09-28. */ +@Deprecated @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/asset/v1beta1/asset_service.proto") diff --git a/synth.metadata b/synth.metadata index 2f4f5bd3e..cc124517f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -73,15 +73,6 @@ "generator": "bazel" } }, - { - "client": { - "source": "googleapis", - "apiName": "asset", - "apiVersion": "v1beta1", - "language": "java", - "generator": "bazel" - } - }, { "client": { "source": "googleapis", @@ -193,13 +184,6 @@ "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java", "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java", "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java", "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java", "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceSettings.java", "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/package-info.java", @@ -231,9 +215,6 @@ "google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java", "google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetService.java", "google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1beta1/AssetServiceClientTest.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetService.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetServiceImpl.java", "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/AssetServiceClientTest.java", "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetService.java", "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetServiceImpl.java", @@ -247,7 +228,6 @@ "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java", "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java", "grpc-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceGrpc.java", - "grpc-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java", "grpc-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceGrpc.java", "grpc-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceGrpc.java", "grpc-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceGrpc.java", @@ -334,31 +314,6 @@ "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/UpdateFeedRequestOrBuilder.java", "proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto", "proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/Asset.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetProto.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceProto.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequest.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequestOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryResponse.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryResponseOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ContentType.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsRequest.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsRequestOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponse.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponseOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestination.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestinationOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfig.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/Resource.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ResourceOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAsset.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAssetOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindow.java", - "proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindowOrBuilder.java", - "proto-google-cloud-asset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/asset_service.proto", - "proto-google-cloud-asset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/assets.proto", "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetProto.java", "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceProto.java", "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResult.java", diff --git a/synth.py b/synth.py index ed6afd39b..165dc7ad5 100644 --- a/synth.py +++ b/synth.py @@ -19,7 +19,7 @@ AUTOSYNTH_MULTIPLE_COMMITS = True service = 'asset' -versions = ['v1', 'v1beta1', 'v1p2beta1', 'v1p1beta1', 'v1p4beta1', 'v1p5beta1'] +versions = ['v1', 'v1p2beta1', 'v1p1beta1', 'v1p4beta1', 'v1p5beta1'] for version in versions: library = java.bazel_library( From 82ee8ae814093e1908d5bdc4880b7dc6ef5bf149 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Dec 2020 19:24:01 +0100 Subject: [PATCH 06/22] test(deps): update dependency com.google.cloud:google-cloud-resourcemanager to v0.118.6-alpha (#435) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 48a0c990d..72dd8cbfc 100644 --- a/pom.xml +++ b/pom.xml @@ -177,7 +177,7 @@ com.google.cloud google-cloud-resourcemanager - 0.118.2-alpha + 0.118.6-alpha test
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9ccc4863f..4bfc760ae 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -59,7 +59,7 @@ com.google.cloud google-cloud-resourcemanager - 0.118.2-alpha + 0.118.6-alpha test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 73a1e27d1..38c360a3a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -58,7 +58,7 @@ com.google.cloud google-cloud-resourcemanager - 0.118.2-alpha + 0.118.6-alpha test From 646a54cef4874b1a58a1748995746fa927be74c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Dec 2020 19:24:36 +0100 Subject: [PATCH 07/22] samples(deps): update dependency com.google.cloud:google-cloud-core to v1.94.0 (#445) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4bfc760ae..f01e28d7a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -36,7 +36,7 @@ com.google.cloud google-cloud-core - 1.93.10 + 1.94.0 com.google.cloud diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 38c360a3a..72d792bcb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -35,7 +35,7 @@ com.google.cloud google-cloud-core - 1.93.10 + 1.94.0 com.google.cloud From 90eae5d9511145ac375929f15396267a22d5d15b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Dec 2020 19:24:56 +0100 Subject: [PATCH 08/22] samples(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.126.3 (#443) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f01e28d7a..c51a36799 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -47,7 +47,7 @@ com.google.cloud google-cloud-bigquery - 1.124.2 + 1.126.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 72d792bcb..482688c33 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -46,7 +46,7 @@ com.google.cloud google-cloud-bigquery - 1.124.2 + 1.126.3 test From c3134c4d70bade1cd65c1c9ddc2dc718dcd73e06 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Dec 2020 19:26:01 +0100 Subject: [PATCH 09/22] test(deps): update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.92.1 (#454) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 72dd8cbfc..e322dc9a0 100644 --- a/pom.xml +++ b/pom.xml @@ -171,7 +171,7 @@ com.google.api.grpc proto-google-cloud-pubsub-v1 - 1.90.7 + 1.92.1 test From aeb8c5ae66c605b3de855b9fe823664b53f51c6f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Dec 2020 21:47:13 +0100 Subject: [PATCH 10/22] samples(deps): update dependency com.google.cloud:google-cloud-storage to v1.113.6 (#472) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c51a36799..7abf8e58d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -41,7 +41,7 @@ com.google.cloud google-cloud-storage - 1.113.4 + 1.113.6 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 482688c33..9c41f919e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -40,7 +40,7 @@ com.google.cloud google-cloud-storage - 1.113.4 + 1.113.6 test From 88b84177f39f2aed64ef48411f3c338591aa2f01 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 23 Dec 2020 11:24:45 -0800 Subject: [PATCH 11/22] chore: migrate to microgenerator (#494) * chore: Remove spurious build warnings by deleting--include_source_info from .bazelrc Committer: @miraleung PiperOrigin-RevId: 344134135 Source-Author: Google APIs Source-Date: Tue Nov 24 14:38:21 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: b11a87f3b54be3a5e42c15020ee1e0781f86da90 Source-Link: https://github.com/googleapis/googleapis/commit/b11a87f3b54be3a5e42c15020ee1e0781f86da90 * chore: fix typo 'partion_key' in comments PiperOrigin-RevId: 345062127 Source-Author: Google APIs Source-Date: Tue Dec 1 11:26:19 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 50831e68c56081dc5908f99158450de5c1c13d1c Source-Link: https://github.com/googleapis/googleapis/commit/50831e68c56081dc5908f99158450de5c1c13d1c * chore: Undo removal of --include_source_info from .bazelrc Committer: @miraleung PiperOrigin-RevId: 345067549 Source-Author: Google APIs Source-Date: Tue Dec 1 11:49:14 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 8cfc6c874574b649b4524a4ef6a0651533325a84 Source-Link: https://github.com/googleapis/googleapis/commit/8cfc6c874574b649b4524a4ef6a0651533325a84 * chore: migrate java-asset to the Java microgenerator Committer: @miraleung PiperOrigin-RevId: 346132907 Source-Author: Google APIs Source-Date: Mon Dec 7 11:04:53 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 8e32936b5907be362322acfa897130ee0e914bcb Source-Link: https://github.com/googleapis/googleapis/commit/8e32936b5907be362322acfa897130ee0e914bcb * chore: update gapic-generator-java to 0.0.9 Committer: @miraleung PiperOrigin-RevId: 346372957 Source-Author: Google APIs Source-Date: Tue Dec 8 11:37:30 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 857f70daef9f4c38f042fb3dfb7b8423ae18fd19 Source-Link: https://github.com/googleapis/googleapis/commit/857f70daef9f4c38f042fb3dfb7b8423ae18fd19 --- .../cloud/asset/v1/AssetServiceClient.java | 659 +++--------------- .../cloud/asset/v1/AssetServiceSettings.java | 48 +- .../google/cloud/asset/v1/package-info.java | 19 +- .../cloud/asset/v1/stub/AssetServiceStub.java | 12 +- .../v1/stub/AssetServiceStubSettings.java | 455 ++++++------ .../stub/GrpcAssetServiceCallableFactory.java | 40 +- .../asset/v1/stub/GrpcAssetServiceStub.java | 71 +- .../asset/v1p1beta1/AssetServiceClient.java | 214 ++---- .../asset/v1p1beta1/AssetServiceSettings.java | 36 +- .../cloud/asset/v1p1beta1/package-info.java | 21 +- .../v1p1beta1/stub/AssetServiceStub.java | 9 +- .../stub/AssetServiceStubSettings.java | 258 ++++--- .../stub/GrpcAssetServiceCallableFactory.java | 40 +- .../v1p1beta1/stub/GrpcAssetServiceStub.java | 38 +- .../asset/v1p2beta1/AssetServiceClient.java | 363 +++------- .../asset/v1p2beta1/AssetServiceSettings.java | 58 +- .../cloud/asset/v1p2beta1/package-info.java | 19 +- .../v1p2beta1/stub/AssetServiceStub.java | 17 +- .../stub/AssetServiceStubSettings.java | 147 ++-- .../stub/GrpcAssetServiceCallableFactory.java | 40 +- .../v1p2beta1/stub/GrpcAssetServiceStub.java | 79 ++- .../asset/v1p4beta1/AssetServiceClient.java | 174 ++--- .../asset/v1p4beta1/AssetServiceSettings.java | 64 +- .../cloud/asset/v1p4beta1/package-info.java | 22 +- .../v1p4beta1/stub/AssetServiceStub.java | 21 +- .../stub/AssetServiceStubSettings.java | 131 ++-- .../stub/GrpcAssetServiceCallableFactory.java | 40 +- .../v1p4beta1/stub/GrpcAssetServiceStub.java | 95 ++- .../asset/v1p5beta1/AssetServiceClient.java | 104 +-- .../asset/v1p5beta1/AssetServiceSettings.java | 38 +- .../cloud/asset/v1p5beta1/package-info.java | 22 +- .../v1p5beta1/stub/AssetServiceStub.java | 9 +- .../stub/AssetServiceStubSettings.java | 177 +++-- .../stub/GrpcAssetServiceCallableFactory.java | 40 +- .../v1p5beta1/stub/GrpcAssetServiceStub.java | 29 +- .../asset/v1/AssetServiceClientTest.java | 362 ++++++---- .../cloud/asset/v1/MockAssetService.java | 6 +- .../cloud/asset/v1/MockAssetServiceImpl.java | 50 +- .../v1p1beta1/AssetServiceClientTest.java | 62 +- .../asset/v1p1beta1/MockAssetService.java | 6 +- .../asset/v1p1beta1/MockAssetServiceImpl.java | 14 +- .../v1p2beta1/AssetServiceClientTest.java | 216 ++++-- .../asset/v1p2beta1/MockAssetService.java | 6 +- .../asset/v1p2beta1/MockAssetServiceImpl.java | 26 +- .../v1p4beta1/AssetServiceClientTest.java | 141 ++-- .../asset/v1p4beta1/MockAssetService.java | 6 +- .../asset/v1p4beta1/MockAssetServiceImpl.java | 14 +- .../v1p5beta1/AssetServiceClientTest.java | 72 +- .../asset/v1p5beta1/MockAssetService.java | 6 +- .../asset/v1p5beta1/MockAssetServiceImpl.java | 10 +- .../cloud/asset/v1/BigQueryDestination.java | 24 +- .../v1/BigQueryDestinationOrBuilder.java | 6 +- .../com/google/cloud/asset/v1/FeedName.java | 173 ++--- .../google/cloud/asset/v1/asset_service.proto | 2 +- .../cloud/asset/v1p2beta1/FeedName.java | 173 ++--- synth.metadata | 30 +- 56 files changed, 2091 insertions(+), 2923 deletions(-) diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java index bd8dc6e78..2f46e25a5 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1; import com.google.api.core.ApiFunction; @@ -38,23 +39,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Asset service definition. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   String parent = "";
- *   Feed response = assetServiceClient.createFeed(parent);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the assetServiceClient object to clean up resources such + *

Note: close() needs to be called on the AssetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -82,30 +74,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; @@ -126,7 +114,7 @@ public static final AssetServiceClient create(AssetServiceSettings settings) thr /** * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use AssetServiceSettings}. + * for advanced usage - prefer using create(AssetServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AssetServiceClient create(AssetServiceStub stub) { @@ -164,13 +152,11 @@ public AssetServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line @@ -181,31 +167,15 @@ public final OperationsClient getOperationsClient() { * exponential retry to poll the export operation result. For regular-size resource parent, the * export operation usually finishes within 5 minutes. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   ExportAssetsRequest request = ExportAssetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture exportAssetsAsync( ExportAssetsRequest request) { return exportAssetsOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line @@ -217,28 +187,13 @@ public final OperationFuture exportAs * export operation usually finishes within 5 minutes. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   ExportAssetsRequest request = ExportAssetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   OperationFuture<ExportAssetsResponse, ExportAssetsRequest> future = assetServiceClient.exportAssetsOperationCallable().futureCall(request);
-   *   // Do something
-   *   ExportAssetsResponse response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable exportAssetsOperationCallable() { return stub.exportAssetsOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line @@ -250,26 +205,12 @@ public final OperationFuture exportAs * export operation usually finishes within 5 minutes. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   ExportAssetsRequest request = ExportAssetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   ApiFuture<Operation> future = assetServiceClient.exportAssetsCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable exportAssetsCallable() { return stub.exportAssetsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, * this API outputs history when the asset and its attached IAM POLICY both exist. This can create @@ -277,18 +218,6 @@ public final UnaryCallable exportAssetsCallable( * or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT * error. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -297,7 +226,7 @@ public final BatchGetAssetsHistoryResponse batchGetAssetsHistory( return batchGetAssetsHistoryCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, * this API outputs history when the asset and its attached IAM POLICY both exist. This can create @@ -306,37 +235,16 @@ public final BatchGetAssetsHistoryResponse batchGetAssetsHistory( * error. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<BatchGetAssetsHistoryResponse> future = assetServiceClient.batchGetAssetsHistoryCallable().futureCall(request);
-   *   // Do something
-   *   BatchGetAssetsHistoryResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable batchGetAssetsHistoryCallable() { return stub.batchGetAssetsHistoryCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a feed in a parent project/folder/organization to listen to its asset updates. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   Feed response = assetServiceClient.createFeed(parent);
-   * }
-   * 
- * * @param parent Required. The name of the project/folder/organization where this feed should be * created in. It can only be an organization number (such as "organizations/123"), a folder * number (such as "folders/123"), a project ID (such as "projects/my-project-id")", or a @@ -348,26 +256,10 @@ public final Feed createFeed(String parent) { return createFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a feed in a parent project/folder/organization to listen to its asset updates. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   String feedId = "";
-   *   Feed feed = Feed.newBuilder().build();
-   *   CreateFeedRequest request = CreateFeedRequest.newBuilder()
-   *     .setParent(parent)
-   *     .setFeedId(feedId)
-   *     .setFeed(feed)
-   *     .build();
-   *   Feed response = assetServiceClient.createFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -375,45 +267,20 @@ public final Feed createFeed(CreateFeedRequest request) { return createFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a feed in a parent project/folder/organization to listen to its asset updates. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   String feedId = "";
-   *   Feed feed = Feed.newBuilder().build();
-   *   CreateFeedRequest request = CreateFeedRequest.newBuilder()
-   *     .setParent(parent)
-   *     .setFeedId(feedId)
-   *     .setFeed(feed)
-   *     .build();
-   *   ApiFuture<Feed> future = assetServiceClient.createFeedCallable().futureCall(request);
-   *   // Do something
-   *   Feed response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createFeedCallable() { return stub.createFeedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   Feed response = assetServiceClient.getFeed(name);
-   * }
-   * 
- * * @param name Required. The name of the Feed and it must be in the format of: * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id @@ -425,19 +292,10 @@ public final Feed getFeed(FeedName name) { return getFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   Feed response = assetServiceClient.getFeed(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the Feed and it must be in the format of: * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id @@ -448,22 +306,10 @@ public final Feed getFeed(String name) { return getFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   GetFeedRequest request = GetFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Feed response = assetServiceClient.getFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -471,41 +317,20 @@ public final Feed getFeed(GetFeedRequest request) { return getFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   GetFeedRequest request = GetFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Feed> future = assetServiceClient.getFeedCallable().futureCall(request);
-   *   // Do something
-   *   Feed response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getFeedCallable() { return stub.getFeedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all asset feeds in a parent project/folder/organization. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListFeedsResponse response = assetServiceClient.listFeeds(parent);
-   * }
-   * 
- * * @param parent Required. The parent project/folder/organization whose feeds are to be listed. It * can only be using project/folder/organization number (such as "folders/12345")", or a * project ID (such as "projects/my-project-id"). @@ -516,22 +341,10 @@ public final ListFeedsResponse listFeeds(String parent) { return listFeeds(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all asset feeds in a parent project/folder/organization. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListFeedsRequest request = ListFeedsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   ListFeedsResponse response = assetServiceClient.listFeeds(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -539,41 +352,20 @@ public final ListFeedsResponse listFeeds(ListFeedsRequest request) { return listFeedsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all asset feeds in a parent project/folder/organization. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListFeedsRequest request = ListFeedsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   ApiFuture<ListFeedsResponse> future = assetServiceClient.listFeedsCallable().futureCall(request);
-   *   // Do something
-   *   ListFeedsResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable listFeedsCallable() { return stub.listFeedsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an asset feed configuration. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   Feed feed = Feed.newBuilder().build();
-   *   Feed response = assetServiceClient.updateFeed(feed);
-   * }
-   * 
- * * @param feed Required. The new values of feed details. It must match an existing feed and the * field `name` must be in the format of: projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id. @@ -584,24 +376,10 @@ public final Feed updateFeed(Feed feed) { return updateFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an asset feed configuration. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   Feed feed = Feed.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFeedRequest request = UpdateFeedRequest.newBuilder()
-   *     .setFeed(feed)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Feed response = assetServiceClient.updateFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -609,43 +387,20 @@ public final Feed updateFeed(UpdateFeedRequest request) { return updateFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an asset feed configuration. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   Feed feed = Feed.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFeedRequest request = UpdateFeedRequest.newBuilder()
-   *     .setFeed(feed)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Feed> future = assetServiceClient.updateFeedCallable().futureCall(request);
-   *   // Do something
-   *   Feed response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateFeedCallable() { return stub.updateFeedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   assetServiceClient.deleteFeed(name);
-   * }
-   * 
- * * @param name Required. The name of the feed and it must be in the format of: * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id @@ -657,19 +412,10 @@ public final void deleteFeed(FeedName name) { deleteFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   assetServiceClient.deleteFeed(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the feed and it must be in the format of: * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id @@ -680,22 +426,10 @@ public final void deleteFeed(String name) { deleteFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   assetServiceClient.deleteFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -703,55 +437,34 @@ public final void deleteFeed(DeleteFeedRequest request) { deleteFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an asset feed. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = assetServiceClient.deleteFeedCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteFeedCallable() { return stub.deleteFeedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all Cloud resources within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission * on the desired scope, otherwise the request will be rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   String query = "";
-   *   List<String> assetTypes = new ArrayList<>();
-   *   for (ResourceSearchResult element : assetServiceClient.searchAllResources(scope, query, assetTypes).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param scope Required. A scope can be a project, a folder, or an organization. The search is * limited to the resources within the `scope`. The caller must be granted the * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. *

The allowed values are: - *

* projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} - * (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * - * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + *

    + *
  • projects/{PROJECT_ID} (e.g., "projects/foo-bar") + *
  • projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + *
  • folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + *
  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + *
+ * * @param query Optional. The query statement. See [how to construct a * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the resources within @@ -761,20 +474,29 @@ public final UnaryCallable deleteFeedCallable() { * policy structure, see [IAM policy * doc](https://cloud.google.com/iam/docs/policies#structure). *

Examples: - *

* `name:Important` to find Cloud resources whose name contains "Important" as a - * word. * `displayName:Impor*` to find Cloud resources whose display name contains - * "Impor" as a prefix. * `description:*por*` to find Cloud resources whose - * description contains "por" as a substring. * `location:us-west*` to find Cloud - * resources whose location is prefixed with "us-west". * `labels:prod` to find Cloud - * resources whose labels contain "prod" as a key or value. * `labels.env:prod` to find - * Cloud resources that have a label "env" and its value is "prod". * `labels.env:*` - * to find Cloud resources that have a label "env". * `Important` to find Cloud resources - * that contain "Important" as a word in any of the searchable fields. * `Impor*` to - * find Cloud resources that contain "Impor" as a prefix in any of the searchable fields. - * * `*por*` to find Cloud resources that contain "por" as a substring in any of - * the searchable fields. * `Important location:(us-west1 OR global)` to find Cloud - * resources that contain "Important" as a word in any of the searchable fields and are also - * located in the "us-west1" region or the "global" location. + *

    + *
  • `name:Important` to find Cloud resources whose name contains "Important" as a word. + *
  • `displayName:Impor*` to find Cloud resources whose display name contains "Impor" + * as a prefix. + *
  • `description:*por*` to find Cloud resources whose description contains "por" + * as a substring. + *
  • `location:us-west*` to find Cloud resources whose location is prefixed with + * "us-west". + *
  • `labels:prod` to find Cloud resources whose labels contain "prod" as a key or value. + *
  • `labels.env:prod` to find Cloud resources that have a label "env" and its value is + * "prod". + *
  • `labels.env:*` to find Cloud resources that have a label "env". + *
  • `Important` to find Cloud resources that contain "Important" as a word in any of the + * searchable fields. + *
  • `Impor*` to find Cloud resources that contain "Impor" as a prefix in any of the + * searchable fields. + *
  • `*por*` to find Cloud resources that contain "por" as a substring in any of + * the searchable fields. + *
  • `Important location:(us-west1 OR global)` to find Cloud resources that contain + * "Important" as a word in any of the searchable fields and are also located in the + * "us-west1" region or the "global" location. + *
+ * * @param assetTypes Optional. A list of asset types that this request searches for. If empty, it * will search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). @@ -791,26 +513,12 @@ public final SearchAllResourcesPagedResponse searchAllResources( return searchAllResources(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all Cloud resources within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission * on the desired scope, otherwise the request will be rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllResourcesRequest request = SearchAllResourcesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   for (ResourceSearchResult element : assetServiceClient.searchAllResources(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -819,111 +527,74 @@ public final SearchAllResourcesPagedResponse searchAllResources( return searchAllResourcesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all Cloud resources within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission * on the desired scope, otherwise the request will be rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllResourcesRequest request = SearchAllResourcesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   ApiFuture<SearchAllResourcesPagedResponse> future = assetServiceClient.searchAllResourcesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (ResourceSearchResult element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllResourcesPagedCallable() { return stub.searchAllResourcesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all Cloud resources within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission * on the desired scope, otherwise the request will be rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllResourcesRequest request = SearchAllResourcesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   while (true) {
-   *     SearchAllResourcesResponse response = assetServiceClient.searchAllResourcesCallable().call(request);
-   *     for (ResourceSearchResult element : response.getResultsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllResourcesCallable() { return stub.searchAllResourcesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all IAM policies within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` * permission on the desired scope, otherwise the request will be rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   String query = "";
-   *   for (IamPolicySearchResult element : assetServiceClient.searchAllIamPolicies(scope, query).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param scope Required. A scope can be a project, a folder, or an organization. The search is * limited to the IAM policies within the `scope`. The caller must be granted the * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. *

The allowed values are: - *

* projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} - * (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * - * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + *

    + *
  • projects/{PROJECT_ID} (e.g., "projects/foo-bar") + *
  • projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + *
  • folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + *
  • organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + *
+ * * @param query Optional. The query statement. See [how to construct a * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the IAM policies within * the specified `scope`. *

Examples: - *

* `policy:amy{@literal @}gmail.com` to find IAM policy bindings that specify user - * "amy{@literal @}gmail.com". * `policy:roles/compute.admin` to find IAM policy bindings - * that specify the Compute Admin role. * `policy.role.permissions:storage.buckets.update` - * to find IAM policy bindings that specify a role containing "storage.buckets.update" - * permission. Note that if callers don't have `iam.roles.get` access to a role's included - * permissions, policy bindings that specify this role will be dropped from the search - * results. * `resource:organizations/123456` to find IAM policy bindings that are set on - * "organizations/123456". * `Important` to find IAM policy bindings that contain - * "Important" as a word in any of the searchable fields (except for the included - * permissions). * `*por*` to find IAM policy bindings that contain "por" as a - * substring in any of the searchable fields (except for the included permissions). * - * `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are set on - * resources "instance1" or "instance2" and also specify user "amy". + *

    + *
  • `policy:amy{@literal @}gmail.com` to find IAM policy bindings that specify user + * "amy{@literal @}gmail.com". + *
  • `policy:roles/compute.admin` to find IAM policy bindings that specify the Compute + * Admin role. + *
  • `policy.role.permissions:storage.buckets.update` to find IAM policy bindings that + * specify a role containing "storage.buckets.update" permission. Note that if callers + * don't have `iam.roles.get` access to a role's included permissions, policy bindings + * that specify this role will be dropped from the search results. + *
  • `resource:organizations/123456` to find IAM policy bindings that are set on + * "organizations/123456". + *
  • `Important` to find IAM policy bindings that contain "Important" as a word in any of + * the searchable fields (except for the included permissions). + *
  • `*por*` to find IAM policy bindings that contain "por" as a substring in any + * of the searchable fields (except for the included permissions). + *
  • `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are + * set on resources "instance1" or "instance2" and also specify user "amy". + *
+ * * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope, String query) { @@ -932,26 +603,12 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope return searchAllIamPolicies(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all IAM policies within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` * permission on the desired scope, otherwise the request will be rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   for (IamPolicySearchResult element : assetServiceClient.searchAllIamPolicies(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -960,83 +617,36 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies( return searchAllIamPoliciesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all IAM policies within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` * permission on the desired scope, otherwise the request will be rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   ApiFuture<SearchAllIamPoliciesPagedResponse> future = assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (IamPolicySearchResult element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllIamPoliciesPagedCallable() { return stub.searchAllIamPoliciesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all IAM policies within the specified scope, such as a project, folder, or * organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` * permission on the desired scope, otherwise the request will be rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   while (true) {
-   *     SearchAllIamPoliciesResponse response = assetServiceClient.searchAllIamPoliciesCallable().call(request);
-   *     for (IamPolicySearchResult element : response.getResultsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllIamPoliciesCallable() { return stub.searchAllIamPoliciesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes IAM policies to answer which identities have what accesses on which resources. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .build();
-   *   AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1044,30 +654,18 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r return analyzeIamPolicyCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes IAM policies to answer which identities have what accesses on which resources. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .build();
-   *   ApiFuture<AnalyzeIamPolicyResponse> future = assetServiceClient.analyzeIamPolicyCallable().futureCall(request);
-   *   // Do something
-   *   AnalyzeIamPolicyResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable analyzeIamPolicyCallable() { return stub.analyzeIamPolicyCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes IAM policies asynchronously to answer which identities have what accesses on which * resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. @@ -1078,32 +676,16 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * backoff retry to poll the operation result. The metadata contains the request to help callers * to map responses to requests. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
-   *   AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   AnalyzeIamPolicyLongrunningResponse response = assetServiceClient.analyzeIamPolicyLongrunningAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture< AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request) { return analyzeIamPolicyLongrunningOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes IAM policies asynchronously to answer which identities have what accesses on which * resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. @@ -1115,22 +697,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * to map responses to requests. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
-   *   AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   OperationFuture<AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> future = assetServiceClient.analyzeIamPolicyLongrunningOperationCallable().futureCall(request);
-   *   // Do something
-   *   AnalyzeIamPolicyLongrunningResponse response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, @@ -1139,7 +706,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r return stub.analyzeIamPolicyLongrunningOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Analyzes IAM policies asynchronously to answer which identities have what accesses on which * resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. @@ -1151,20 +718,6 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * to map responses to requests. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
-   *   AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   ApiFuture<Operation> future = assetServiceClient.analyzeIamPolicyLongrunningCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable analyzeIamPolicyLongrunningCallable() { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java index a60a03ae6..4ec46c787 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceClient}. * @@ -52,33 +53,31 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of createFeed to 30 seconds: + *

For example, to set the total timeout of batchGetAssetsHistory to 30 seconds: * - *

- * 
- * AssetServiceSettings.Builder assetServiceSettingsBuilder =
- *     AssetServiceSettings.newBuilder();
+ * 
{@code
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
  * assetServiceSettingsBuilder
- *     .createFeedSettings()
+ *     .batchGetAssetsHistorySettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.createFeedSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .batchGetAssetsHistorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to exportAssets. */ public UnaryCallSettings exportAssetsSettings() { return ((AssetServiceStubSettings) getStubSettings()).exportAssetsSettings(); } /** Returns the object with the settings used for calls to exportAssets. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings exportAssetsOperationSettings() { return ((AssetServiceStubSettings) getStubSettings()).exportAssetsOperationSettings(); @@ -144,8 +143,6 @@ public UnaryCallSettings deleteFeedSettings() { } /** Returns the object with the settings used for calls to analyzeIamPolicyLongrunning. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, @@ -215,18 +212,15 @@ protected AssetServiceSettings(Builder settingsBuilder) throws IOException { /** Builder for AssetServiceSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AssetServiceStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AssetServiceStubSettings.newBuilder()); - } - protected Builder(AssetServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -235,11 +229,15 @@ protected Builder(AssetServiceStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { return ((AssetServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -258,8 +256,6 @@ public UnaryCallSettings.Builder exportAssetsSet } /** Returns the builder for the settings used for calls to exportAssets. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder< ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> exportAssetsOperationSettings() { @@ -326,8 +322,6 @@ public UnaryCallSettings.Builder deleteFeedSettings() } /** Returns the builder for the settings used for calls to analyzeIamPolicyLongrunning. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java index 8d3107e5b..e57f64180 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -15,26 +15,15 @@ */ /** - * A client to Cloud Asset API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

================== AssetServiceClient ================== + *

======================= AssetServiceClient ======================= * *

Service Description: Asset service definition. * *

Sample for AssetServiceClient: - * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   String parent = "";
- *   Feed response = assetServiceClient.createFeed(parent);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.asset.v1; import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java index 9c0d75e1b..28ba90e0e 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1.stub; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -46,22 +46,19 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Cloud Asset API. + * Base stub class for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AssetServiceStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable exportAssetsOperationCallable() { throw new UnsupportedOperationException("Not implemented: exportAssetsOperationCallable()"); @@ -121,7 +118,6 @@ public UnaryCallable deleteFeedCallable() { throw new UnsupportedOperationException("Not implemented: analyzeIamPolicyCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 0f4a285e9..f26202eb9 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1.stub; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; @@ -76,7 +77,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceStub}. * @@ -91,24 +92,25 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of createFeed to 30 seconds: + *

For example, to set the total timeout of batchGetAssetsHistory to 30 seconds: * - *

- * 
+ * 
{@code
  * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
  *     AssetServiceStubSettings.newBuilder();
  * assetServiceSettingsBuilder
- *     .createFeedSettings()
+ *     .batchGetAssetsHistorySettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.createFeedSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .batchGetAssetsHistorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -143,13 +145,142 @@ public class AssetServiceStubSettings extends StubSettings analyzeIamPolicyLongrunningOperationSettings; + private static final PagedListDescriptor< + SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> + SEARCH_ALL_RESOURCES_PAGE_STR_DESC = + new PagedListDescriptor< + SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchAllResourcesRequest injectToken( + SearchAllResourcesRequest payload, String token) { + return SearchAllResourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchAllResourcesRequest injectPageSize( + SearchAllResourcesRequest payload, int pageSize) { + return SearchAllResourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchAllResourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchAllResourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + SearchAllResourcesResponse payload) { + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); + } + }; + + private static final PagedListDescriptor< + SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> + SEARCH_ALL_IAM_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchAllIamPoliciesRequest injectToken( + SearchAllIamPoliciesRequest payload, String token) { + return SearchAllIamPoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchAllIamPoliciesRequest injectPageSize( + SearchAllIamPoliciesRequest payload, int pageSize) { + return SearchAllIamPoliciesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchAllIamPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchAllIamPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + SearchAllIamPoliciesResponse payload) { + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); + } + }; + + private static final PagedListResponseFactory< + SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse> + SEARCH_ALL_RESOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchAllResourcesRequest, + SearchAllResourcesResponse, + SearchAllResourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchAllResourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> + pageContext = + PageContext.create( + callable, SEARCH_ALL_RESOURCES_PAGE_STR_DESC, request, context); + return SearchAllResourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + SearchAllIamPoliciesPagedResponse> + SEARCH_ALL_IAM_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + SearchAllIamPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchAllIamPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + IamPolicySearchResult> + pageContext = + PageContext.create( + callable, SEARCH_ALL_IAM_POLICIES_PAGE_STR_DESC, request, context); + return SearchAllIamPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to exportAssets. */ public UnaryCallSettings exportAssetsSettings() { return exportAssetsSettings; } /** Returns the object with the settings used for calls to exportAssets. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings exportAssetsOperationSettings() { return exportAssetsOperationSettings; @@ -215,7 +346,6 @@ public UnaryCallSettings deleteFeedSettings() { } /** Returns the object with the settings used for calls to analyzeIamPolicyLongrunning. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, @@ -230,10 +360,10 @@ public AssetServiceStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAssetServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -310,140 +440,9 @@ protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.analyzeIamPolicyLongrunningOperationSettings().build(); } - private static final PagedListDescriptor< - SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> - SEARCH_ALL_RESOURCES_PAGE_STR_DESC = - new PagedListDescriptor< - SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public SearchAllResourcesRequest injectToken( - SearchAllResourcesRequest payload, String token) { - return SearchAllResourcesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public SearchAllResourcesRequest injectPageSize( - SearchAllResourcesRequest payload, int pageSize) { - return SearchAllResourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(SearchAllResourcesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(SearchAllResourcesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - SearchAllResourcesResponse payload) { - return payload.getResultsList() != null - ? payload.getResultsList() - : ImmutableList.of(); - } - }; - - private static final PagedListDescriptor< - SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult> - SEARCH_ALL_IAM_POLICIES_PAGE_STR_DESC = - new PagedListDescriptor< - SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse, IamPolicySearchResult>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public SearchAllIamPoliciesRequest injectToken( - SearchAllIamPoliciesRequest payload, String token) { - return SearchAllIamPoliciesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public SearchAllIamPoliciesRequest injectPageSize( - SearchAllIamPoliciesRequest payload, int pageSize) { - return SearchAllIamPoliciesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(SearchAllIamPoliciesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(SearchAllIamPoliciesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - SearchAllIamPoliciesResponse payload) { - return payload.getResultsList() != null - ? payload.getResultsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse> - SEARCH_ALL_RESOURCES_PAGE_STR_FACT = - new PagedListResponseFactory< - SearchAllResourcesRequest, - SearchAllResourcesResponse, - SearchAllResourcesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - SearchAllResourcesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - SearchAllResourcesRequest, SearchAllResourcesResponse, ResourceSearchResult> - pageContext = - PageContext.create( - callable, SEARCH_ALL_RESOURCES_PAGE_STR_DESC, request, context); - return SearchAllResourcesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - SearchAllIamPoliciesRequest, - SearchAllIamPoliciesResponse, - SearchAllIamPoliciesPagedResponse> - SEARCH_ALL_IAM_POLICIES_PAGE_STR_FACT = - new PagedListResponseFactory< - SearchAllIamPoliciesRequest, - SearchAllIamPoliciesResponse, - SearchAllIamPoliciesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - SearchAllIamPoliciesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - SearchAllIamPoliciesRequest, - SearchAllIamPoliciesResponse, - IamPolicySearchResult> - pageContext = - PageContext.create( - callable, SEARCH_ALL_IAM_POLICIES_PAGE_STR_DESC, request, context); - return SearchAllIamPoliciesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for AssetServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder exportAssetsSettings; private final OperationCallSettings.Builder< ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> @@ -473,29 +472,27 @@ public static class Builder extends StubSettings.Builder analyzeIamPolicyLongrunningOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_3_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); definitions.put( "retry_policy_2_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "retry_policy_3_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -504,6 +501,14 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); settings = RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(100L)) @@ -537,51 +542,29 @@ public static class Builder extends StubSettings.Builder>of( + exportAssetsSettings, + batchGetAssetsHistorySettings, + createFeedSettings, + getFeedSettings, + listFeedsSettings, + updateFeedSettings, + deleteFeedSettings, + searchAllResourcesSettings, + searchAllIamPoliciesSettings, + analyzeIamPolicySettings, + analyzeIamPolicyLongrunningSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .exportAssetsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .batchGetAssetsHistorySettings() @@ -624,8 +641,8 @@ private static Builder initDefaults(Builder builder) { builder .createFeedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getFeedSettings() @@ -639,8 +656,8 @@ private static Builder initDefaults(Builder builder) { builder .updateFeedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .deleteFeedSettings() @@ -664,15 +681,16 @@ private static Builder initDefaults(Builder builder) { builder .analyzeIamPolicyLongrunningSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .exportAssetsOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(ExportAssetsResponse.class)) @@ -681,22 +699,23 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .analyzeIamPolicyLongrunningOperationSettings() .setInitialCallSettings( UnaryCallSettings . newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create( @@ -707,53 +726,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(AssetServiceStubSettings settings) { - super(settings); - - exportAssetsSettings = settings.exportAssetsSettings.toBuilder(); - exportAssetsOperationSettings = settings.exportAssetsOperationSettings.toBuilder(); - batchGetAssetsHistorySettings = settings.batchGetAssetsHistorySettings.toBuilder(); - createFeedSettings = settings.createFeedSettings.toBuilder(); - getFeedSettings = settings.getFeedSettings.toBuilder(); - listFeedsSettings = settings.listFeedsSettings.toBuilder(); - updateFeedSettings = settings.updateFeedSettings.toBuilder(); - deleteFeedSettings = settings.deleteFeedSettings.toBuilder(); - searchAllResourcesSettings = settings.searchAllResourcesSettings.toBuilder(); - searchAllIamPoliciesSettings = settings.searchAllIamPoliciesSettings.toBuilder(); - analyzeIamPolicySettings = settings.analyzeIamPolicySettings.toBuilder(); - analyzeIamPolicyLongrunningSettings = - settings.analyzeIamPolicyLongrunningSettings.toBuilder(); - analyzeIamPolicyLongrunningOperationSettings = - settings.analyzeIamPolicyLongrunningOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - exportAssetsSettings, - batchGetAssetsHistorySettings, - createFeedSettings, - getFeedSettings, - listFeedsSettings, - updateFeedSettings, - deleteFeedSettings, - searchAllResourcesSettings, - searchAllIamPoliciesSettings, - analyzeIamPolicySettings, - analyzeIamPolicyLongrunningSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java index 5e0841a63..e67f9e56f 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Cloud Asset API. + * gRPC callable factory implementation for the AssetService service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java index cd2f83637..ddb8fe5cc 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1.stub; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -57,16 +57,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Cloud Asset API. + * gRPC stub implementation for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAssetServiceStub extends AssetServiceStub { - private static final MethodDescriptor exportAssetsMethodDescriptor = MethodDescriptor.newBuilder() @@ -75,6 +73,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(ExportAssetsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor batchGetAssetsHistoryMethodDescriptor = MethodDescriptor.newBuilder() @@ -85,6 +84,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller( ProtoUtils.marshaller(BatchGetAssetsHistoryResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor createFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -92,6 +92,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) .build(); + private static final MethodDescriptor getFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -99,6 +100,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(GetFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) .build(); + private static final MethodDescriptor listFeedsMethodDescriptor = MethodDescriptor.newBuilder() @@ -107,6 +109,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(ListFeedsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListFeedsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor updateFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -114,6 +117,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -121,6 +125,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor searchAllResourcesMethodDescriptor = MethodDescriptor.newBuilder() @@ -131,6 +136,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller( ProtoUtils.marshaller(SearchAllResourcesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor searchAllIamPoliciesMethodDescriptor = MethodDescriptor.newBuilder() @@ -141,6 +147,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller( ProtoUtils.marshaller(SearchAllIamPoliciesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor analyzeIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() @@ -151,6 +158,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller( ProtoUtils.marshaller(AnalyzeIamPolicyResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor analyzeIamPolicyLongrunningMethodDescriptor = MethodDescriptor.newBuilder() @@ -161,9 +169,6 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable exportAssetsCallable; private final OperationCallable exportAssetsOperationCallable; @@ -192,6 +197,8 @@ public class GrpcAssetServiceStub extends AssetServiceStub { AnalyzeIamPolicyLongrunningRequest> analyzeIamPolicyLongrunningOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) @@ -395,7 +402,7 @@ public Map extract( exportAssetsTransportSettings, settings.exportAssetsOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.batchGetAssetsHistoryCallable = callableFactory.createUnaryCallable( batchGetAssetsHistoryTransportSettings, @@ -449,26 +456,25 @@ public Map extract( analyzeIamPolicyLongrunningTransportSettings, settings.analyzeIamPolicyLongrunningOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable exportAssetsCallable() { + return exportAssetsCallable; + } + public OperationCallable exportAssetsOperationCallable() { return exportAssetsOperationCallable; } - public UnaryCallable exportAssetsCallable() { - return exportAssetsCallable; - } - public UnaryCallable batchGetAssetsHistoryCallable() { return batchGetAssetsHistoryCallable; @@ -494,19 +500,14 @@ public UnaryCallable deleteFeedCallable() { return deleteFeedCallable; } - public UnaryCallable - searchAllResourcesPagedCallable() { - return searchAllResourcesPagedCallable; - } - public UnaryCallable searchAllResourcesCallable() { return searchAllResourcesCallable; } - public UnaryCallable - searchAllIamPoliciesPagedCallable() { - return searchAllIamPoliciesPagedCallable; + public UnaryCallable + searchAllResourcesPagedCallable() { + return searchAllResourcesPagedCallable; } public UnaryCallable @@ -514,12 +515,21 @@ public UnaryCallable deleteFeedCallable() { return searchAllIamPoliciesCallable; } + public UnaryCallable + searchAllIamPoliciesPagedCallable() { + return searchAllIamPoliciesPagedCallable; + } + public UnaryCallable analyzeIamPolicyCallable() { return analyzeIamPolicyCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable + analyzeIamPolicyLongrunningCallable() { + return analyzeIamPolicyLongrunningCallable; + } + public OperationCallable< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, @@ -528,11 +538,6 @@ public UnaryCallable deleteFeedCallable() { return analyzeIamPolicyLongrunningOperationCallable; } - public UnaryCallable - analyzeIamPolicyLongrunningCallable() { - return analyzeIamPolicyLongrunningCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java index 0aa3572cc..f5e98d2cb 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1; import com.google.api.core.ApiFunction; @@ -33,27 +34,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Asset service definition. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   String scope = "";
- *   String query = "";
- *   List<String> assetTypes = new ArrayList<>();
- *   for (StandardResourceMetadata element : assetServiceClient.searchAllResources(scope, query, assetTypes).iterateAll()) {
- *     // doThingsWith(element);
- *   }
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the assetServiceClient object to clean up resources such + *

Note: close() needs to be called on the AssetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -81,30 +69,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; @@ -124,7 +108,7 @@ public static final AssetServiceClient create(AssetServiceSettings settings) thr /** * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use AssetServiceSettings}. + * for advanced usage - prefer using create(AssetServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AssetServiceClient create(AssetServiceStub stub) { @@ -156,7 +140,7 @@ public AssetServiceStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the resources under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the resources under a scope, @@ -164,23 +148,15 @@ public AssetServiceStub getStub() { * cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be * rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   String query = "";
-   *   List<String> assetTypes = new ArrayList<>();
-   *   for (StandardResourceMetadata element : assetServiceClient.searchAllResources(scope, query, assetTypes).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param scope Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: * Organization number (such as - * "organizations/123") * Folder number(such as "folders/1234") * Project number (such - * as "projects/12345") * Project id (such as "projects/abc") + * within the `scope`. The allowed value must be: + *
    + *
  • Organization number (such as "organizations/123") + *
  • Folder number(such as "folders/1234") + *
  • Project number (such as "projects/12345") + *
  • Project id (such as "projects/abc") + *
+ * * @param query Optional. The query statement. * @param assetTypes Optional. A list of asset types that this request searches for. If empty, it * will search all the supported asset types. @@ -197,7 +173,7 @@ public final SearchAllResourcesPagedResponse searchAllResources( return searchAllResources(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the resources under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the resources under a scope, @@ -205,20 +181,6 @@ public final SearchAllResourcesPagedResponse searchAllResources( * cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be * rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllResourcesRequest request = SearchAllResourcesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   for (StandardResourceMetadata element : assetServiceClient.searchAllResources(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,7 +189,7 @@ public final SearchAllResourcesPagedResponse searchAllResources( return searchAllResourcesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the resources under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the resources under a scope, @@ -236,27 +198,13 @@ public final SearchAllResourcesPagedResponse searchAllResources( * rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllResourcesRequest request = SearchAllResourcesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   ApiFuture<SearchAllResourcesPagedResponse> future = assetServiceClient.searchAllResourcesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (StandardResourceMetadata element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllResourcesPagedCallable() { return stub.searchAllResourcesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the resources under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the resources under a scope, @@ -265,34 +213,13 @@ public final SearchAllResourcesPagedResponse searchAllResources( * rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllResourcesRequest request = SearchAllResourcesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   while (true) {
-   *     SearchAllResourcesResponse response = assetServiceClient.searchAllResourcesCallable().call(request);
-   *     for (StandardResourceMetadata element : response.getResultsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllResourcesCallable() { return stub.searchAllResourcesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the IAM policies under a @@ -300,25 +227,21 @@ public final SearchAllResourcesPagedResponse searchAllResources( * have cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be * rejected. * - *

Sample code: + * @param scope Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + *

    + *
  • Organization number (such as "organizations/123") + *
  • Folder number(such as "folders/1234") + *
  • Project number (such as "projects/12345") + *
  • Project id (such as "projects/abc") + *
* - *

-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   String query = "";
-   *   for (IamPolicySearchResult element : assetServiceClient.searchAllIamPolicies(scope, query).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
+ * @param query Optional. The query statement. Examples: + *
    + *
  • "policy:myuser{@literal @}mydomain.com" + *
  • "policy:(myuser{@literal @}mydomain.com viewer)" + *
* - * @param scope Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: * Organization number (such as - * "organizations/123") * Folder number(such as "folders/1234") * Project number (such - * as "projects/12345") * Project id (such as "projects/abc") - * @param query Optional. The query statement. Examples: * - * "policy:myuser{@literal @}mydomain.com" * "policy:(myuser{@literal @}mydomain.com - * viewer)" * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope, String query) { @@ -327,7 +250,7 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope return searchAllIamPolicies(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the IAM policies under a @@ -335,20 +258,6 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope * have cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be * rejected. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   for (IamPolicySearchResult element : assetServiceClient.searchAllIamPolicies(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -357,7 +266,7 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies( return searchAllIamPoliciesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the IAM policies under a @@ -366,27 +275,13 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies( * rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   ApiFuture<SearchAllIamPoliciesPagedResponse> future = assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (IamPolicySearchResult element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllIamPoliciesPagedCallable() { return stub.searchAllIamPoliciesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). * This RPC gives callers especially admins the ability to search all the IAM policies under a @@ -395,27 +290,6 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies( * rejected. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String scope = "";
-   *   SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder()
-   *     .setScope(scope)
-   *     .build();
-   *   while (true) {
-   *     SearchAllIamPoliciesResponse response = assetServiceClient.searchAllIamPoliciesCallable().call(request);
-   *     for (IamPolicySearchResult element : response.getResultsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable searchAllIamPoliciesCallable() { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceSettings.java index e4bf6a2a7..e3b2eb8a4 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceClient}. * @@ -51,23 +52,23 @@ * *

For example, to set the total timeout of searchAllResources to 30 seconds: * - *

- * 
- * AssetServiceSettings.Builder assetServiceSettingsBuilder =
- *     AssetServiceSettings.newBuilder();
+ * 
{@code
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
  * assetServiceSettingsBuilder
  *     .searchAllResourcesSettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.searchAllResourcesSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .searchAllResourcesSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to searchAllResources. */ public PagedCallSettings< SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse> @@ -144,18 +145,15 @@ protected AssetServiceSettings(Builder settingsBuilder) throws IOException { /** Builder for AssetServiceSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AssetServiceStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AssetServiceStubSettings.newBuilder()); - } - protected Builder(AssetServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -164,11 +162,15 @@ protected Builder(AssetServiceStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { return ((AssetServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/package-info.java index 09f1e8828..429d478f7 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/package-info.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -15,28 +15,15 @@ */ /** - * A client to Cloud Asset API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

================== AssetServiceClient ================== + *

======================= AssetServiceClient ======================= * *

Service Description: Asset service definition. * *

Sample for AssetServiceClient: - * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   String scope = "";
- *   String query = "";
- *   List<String> assetTypes = new ArrayList<>();
- *   SearchAllResourcesPagedResponse response = assetServiceClient.searchAllResources(scope, query, assetTypes);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.asset.v1p1beta1; import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStub.java index 5c7ad8743..e6203cfdb 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1.stub; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllResourcesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; @@ -27,14 +27,13 @@ import com.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Cloud Asset API. + * Base stub class for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AssetServiceStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java index 2573fb95e..9b61f457b 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1.stub; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; @@ -55,7 +56,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceStub}. * @@ -72,22 +73,23 @@ * *

For example, to set the total timeout of searchAllResources to 30 seconds: * - *

- * 
+ * 
{@code
  * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
  *     AssetServiceStubSettings.newBuilder();
  * assetServiceSettingsBuilder
  *     .searchAllResourcesSettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.searchAllResourcesSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .searchAllResourcesSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -102,95 +104,6 @@ public class AssetServiceStubSettings extends StubSettings searchAllIamPoliciesSettings; - /** Returns the object with the settings used for calls to searchAllResources. */ - public PagedCallSettings< - SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse> - searchAllResourcesSettings() { - return searchAllResourcesSettings; - } - - /** Returns the object with the settings used for calls to searchAllIamPolicies. */ - public PagedCallSettings< - SearchAllIamPoliciesRequest, - SearchAllIamPoliciesResponse, - SearchAllIamPoliciesPagedResponse> - searchAllIamPoliciesSettings() { - return searchAllIamPoliciesSettings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public AssetServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcAssetServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "cloudasset.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(AssetServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - searchAllResourcesSettings = settingsBuilder.searchAllResourcesSettings().build(); - searchAllIamPoliciesSettings = settingsBuilder.searchAllIamPoliciesSettings().build(); - } - private static final PagedListDescriptor< SearchAllResourcesRequest, SearchAllResourcesResponse, StandardResourceMetadata> SEARCH_ALL_RESOURCES_PAGE_STR_DESC = @@ -226,9 +139,9 @@ public String extractNextToken(SearchAllResourcesResponse payload) { @Override public Iterable extractResources( SearchAllResourcesResponse payload) { - return payload.getResultsList() != null - ? payload.getResultsList() - : ImmutableList.of(); + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); } }; @@ -267,9 +180,9 @@ public String extractNextToken(SearchAllIamPoliciesResponse payload) { @Override public Iterable extractResources( SearchAllIamPoliciesResponse payload) { - return payload.getResultsList() != null - ? payload.getResultsList() - : ImmutableList.of(); + return payload.getResultsList() == null + ? ImmutableList.of() + : payload.getResultsList(); } }; @@ -323,10 +236,98 @@ public ApiFuture getFuturePagedResponse( } }; + /** Returns the object with the settings used for calls to searchAllResources. */ + public PagedCallSettings< + SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse> + searchAllResourcesSettings() { + return searchAllResourcesSettings; + } + + /** Returns the object with the settings used for calls to searchAllIamPolicies. */ + public PagedCallSettings< + SearchAllIamPoliciesRequest, + SearchAllIamPoliciesResponse, + SearchAllIamPoliciesPagedResponse> + searchAllIamPoliciesSettings() { + return searchAllIamPoliciesSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssetServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAssetServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudasset.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AssetServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + searchAllResourcesSettings = settingsBuilder.searchAllResourcesSettings().build(); + searchAllIamPoliciesSettings = settingsBuilder.searchAllIamPoliciesSettings().build(); + } + /** Builder for AssetServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse> searchAllResourcesSettings; @@ -335,7 +336,6 @@ public static class Builder extends StubSettings.Builder searchAllIamPoliciesSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -343,11 +343,10 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -366,67 +365,64 @@ public static class Builder extends StubSettings.Builder>of( searchAllResourcesSettings, searchAllIamPoliciesSettings); - initDefaults(this); } + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + searchAllResourcesSettings = settings.searchAllResourcesSettings.toBuilder(); + searchAllIamPoliciesSettings = settings.searchAllIamPoliciesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + searchAllResourcesSettings, searchAllIamPoliciesSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .searchAllResourcesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .searchAllIamPoliciesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(AssetServiceStubSettings settings) { - super(settings); - - searchAllResourcesSettings = settings.searchAllResourcesSettings.toBuilder(); - searchAllIamPoliciesSettings = settings.searchAllIamPoliciesSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - searchAllResourcesSettings, searchAllIamPoliciesSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceCallableFactory.java index 076480e6f..c16265093 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceCallableFactory.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Cloud Asset API. + * gRPC callable factory implementation for the AssetService service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceStub.java index 015c232b1..cd06aeab9 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1.stub; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllResourcesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -31,6 +31,7 @@ import com.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; import com.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -38,16 +39,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Cloud Asset API. + * gRPC stub implementation for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAssetServiceStub extends AssetServiceStub { - private static final MethodDescriptor searchAllResourcesMethodDescriptor = MethodDescriptor.newBuilder() @@ -58,6 +57,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller( ProtoUtils.marshaller(SearchAllResourcesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor searchAllIamPoliciesMethodDescriptor = MethodDescriptor.newBuilder() @@ -69,8 +69,6 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ProtoUtils.marshaller(SearchAllIamPoliciesResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable searchAllResourcesCallable; private final UnaryCallable @@ -80,6 +78,8 @@ public class GrpcAssetServiceStub extends AssetServiceStub { private final UnaryCallable searchAllIamPoliciesPagedCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) @@ -118,6 +118,7 @@ protected GrpcAssetServiceStub( GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings searchAllResourcesTransportSettings = @@ -169,12 +170,12 @@ public Map extract(SearchAllIamPoliciesRequest request) { settings.searchAllIamPoliciesSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - searchAllResourcesPagedCallable() { - return searchAllResourcesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable @@ -182,9 +183,9 @@ public Map extract(SearchAllIamPoliciesRequest request) { return searchAllResourcesCallable; } - public UnaryCallable - searchAllIamPoliciesPagedCallable() { - return searchAllIamPoliciesPagedCallable; + public UnaryCallable + searchAllResourcesPagedCallable() { + return searchAllResourcesPagedCallable; } public UnaryCallable @@ -192,6 +193,11 @@ public Map extract(SearchAllIamPoliciesRequest request) { return searchAllIamPoliciesCallable; } + public UnaryCallable + searchAllIamPoliciesPagedCallable() { + return searchAllIamPoliciesPagedCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceClient.java index 8ae3e42b9..9b235d456 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1; import com.google.api.core.BetaApi; @@ -25,23 +26,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Asset service definition. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
- *   assetServiceClient.deleteFeed(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the assetServiceClient object to clean up resources such + *

Note: close() needs to be called on the AssetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -69,30 +61,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; @@ -112,7 +100,7 @@ public static final AssetServiceClient create(AssetServiceSettings settings) thr /** * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use AssetServiceSettings}. + * for advanced usage - prefer using create(AssetServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AssetServiceClient create(AssetServiceStub stub) { @@ -144,111 +132,10 @@ public AssetServiceStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an asset feed. - * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   assetServiceClient.deleteFeed(name);
-   * }
-   * 
- * - * @param name Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteFeed(FeedName name) { - DeleteFeedRequest request = - DeleteFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteFeed(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an asset feed. - * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   assetServiceClient.deleteFeed(name.toString());
-   * }
-   * 
- * - * @param name Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteFeed(String name) { - DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name).build(); - deleteFeed(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an asset feed. - * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   assetServiceClient.deleteFeed(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteFeed(DeleteFeedRequest request) { - deleteFeedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an asset feed. - * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = assetServiceClient.deleteFeedCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteFeedCallable() { - return stub.deleteFeedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a feed in a parent project/folder/organization to listen to its asset updates. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   Feed response = assetServiceClient.createFeed(parent);
-   * }
-   * 
- * * @param parent Required. The name of the project/folder/organization where this feed should be * created in. It can only be an organization number (such as "organizations/123"), a folder * number (such as "folders/123"), a project ID (such as "projects/my-project-id")", or a @@ -260,26 +147,10 @@ public final Feed createFeed(String parent) { return createFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a feed in a parent project/folder/organization to listen to its asset updates. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   String feedId = "";
-   *   Feed feed = Feed.newBuilder().build();
-   *   CreateFeedRequest request = CreateFeedRequest.newBuilder()
-   *     .setParent(parent)
-   *     .setFeedId(feedId)
-   *     .setFeed(feed)
-   *     .build();
-   *   Feed response = assetServiceClient.createFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -287,45 +158,20 @@ public final Feed createFeed(CreateFeedRequest request) { return createFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a feed in a parent project/folder/organization to listen to its asset updates. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   String feedId = "";
-   *   Feed feed = Feed.newBuilder().build();
-   *   CreateFeedRequest request = CreateFeedRequest.newBuilder()
-   *     .setParent(parent)
-   *     .setFeedId(feedId)
-   *     .setFeed(feed)
-   *     .build();
-   *   ApiFuture<Feed> future = assetServiceClient.createFeedCallable().futureCall(request);
-   *   // Do something
-   *   Feed response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createFeedCallable() { return stub.createFeedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   Feed response = assetServiceClient.getFeed(name);
-   * }
-   * 
- * * @param name Required. The name of the Feed and it must be in the format of: * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id @@ -337,19 +183,10 @@ public final Feed getFeed(FeedName name) { return getFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   Feed response = assetServiceClient.getFeed(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the Feed and it must be in the format of: * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id * organizations/organization_number/feeds/feed_id @@ -360,22 +197,10 @@ public final Feed getFeed(String name) { return getFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   GetFeedRequest request = GetFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Feed response = assetServiceClient.getFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -383,41 +208,20 @@ public final Feed getFeed(GetFeedRequest request) { return getFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details about an asset feed. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
-   *   GetFeedRequest request = GetFeedRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Feed> future = assetServiceClient.getFeedCallable().futureCall(request);
-   *   // Do something
-   *   Feed response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getFeedCallable() { return stub.getFeedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all asset feeds in a parent project/folder/organization. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListFeedsResponse response = assetServiceClient.listFeeds(parent);
-   * }
-   * 
- * * @param parent Required. The parent project/folder/organization whose feeds are to be listed. It * can only be using project/folder/organization number (such as "folders/12345")", or a * project ID (such as "projects/my-project-id"). @@ -428,22 +232,10 @@ public final ListFeedsResponse listFeeds(String parent) { return listFeeds(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all asset feeds in a parent project/folder/organization. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListFeedsRequest request = ListFeedsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   ListFeedsResponse response = assetServiceClient.listFeeds(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -451,41 +243,20 @@ public final ListFeedsResponse listFeeds(ListFeedsRequest request) { return listFeedsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all asset feeds in a parent project/folder/organization. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListFeedsRequest request = ListFeedsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   ApiFuture<ListFeedsResponse> future = assetServiceClient.listFeedsCallable().futureCall(request);
-   *   // Do something
-   *   ListFeedsResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable listFeedsCallable() { return stub.listFeedsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an asset feed configuration. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   Feed feed = Feed.newBuilder().build();
-   *   Feed response = assetServiceClient.updateFeed(feed);
-   * }
-   * 
- * * @param feed Required. The new values of feed details. It must match an existing feed and the * field `name` must be in the format of: projects/project_number/feeds/feed_id or * folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id. @@ -496,24 +267,10 @@ public final Feed updateFeed(Feed feed) { return updateFeed(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an asset feed configuration. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   Feed feed = Feed.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFeedRequest request = UpdateFeedRequest.newBuilder()
-   *     .setFeed(feed)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Feed response = assetServiceClient.updateFeed(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -521,30 +278,66 @@ public final Feed updateFeed(UpdateFeedRequest request) { return updateFeedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an asset feed configuration. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   Feed feed = Feed.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFeedRequest request = UpdateFeedRequest.newBuilder()
-   *     .setFeed(feed)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Feed> future = assetServiceClient.updateFeedCallable().futureCall(request);
-   *   // Do something
-   *   Feed response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateFeedCallable() { return stub.updateFeedCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an asset feed. + * + * @param name Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFeed(FeedName name) { + DeleteFeedRequest request = + DeleteFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteFeed(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an asset feed. + * + * @param name Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFeed(String name) { + DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name).build(); + deleteFeed(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an asset feed. + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFeed(DeleteFeedRequest request) { + deleteFeedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an asset feed. + * + *

Sample code: + */ + public final UnaryCallable deleteFeedCallable() { + return stub.deleteFeedCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceSettings.java index 3b3daa8f6..6bd7b8316 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1; import com.google.api.core.ApiFunction; @@ -31,7 +32,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceClient}. * @@ -46,29 +47,24 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteFeed to 30 seconds: + *

For example, to set the total timeout of createFeed to 30 seconds: * - *

- * 
- * AssetServiceSettings.Builder assetServiceSettingsBuilder =
- *     AssetServiceSettings.newBuilder();
+ * 
{@code
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
  * assetServiceSettingsBuilder
- *     .deleteFeedSettings()
+ *     .createFeedSettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.deleteFeedSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .createFeedSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { - /** Returns the object with the settings used for calls to deleteFeed. */ - public UnaryCallSettings deleteFeedSettings() { - return ((AssetServiceStubSettings) getStubSettings()).deleteFeedSettings(); - } /** Returns the object with the settings used for calls to createFeed. */ public UnaryCallSettings createFeedSettings() { @@ -90,6 +86,11 @@ public UnaryCallSettings updateFeedSettings() { return ((AssetServiceStubSettings) getStubSettings()).updateFeedSettings(); } + /** Returns the object with the settings used for calls to deleteFeed. */ + public UnaryCallSettings deleteFeedSettings() { + return ((AssetServiceStubSettings) getStubSettings()).deleteFeedSettings(); + } + public static final AssetServiceSettings create(AssetServiceStubSettings stub) throws IOException { return new AssetServiceSettings.Builder(stub.toBuilder()).build(); @@ -150,18 +151,15 @@ protected AssetServiceSettings(Builder settingsBuilder) throws IOException { /** Builder for AssetServiceSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AssetServiceStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AssetServiceStubSettings.newBuilder()); - } - protected Builder(AssetServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -170,11 +168,15 @@ protected Builder(AssetServiceStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { return ((AssetServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -187,11 +189,6 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to deleteFeed. */ - public UnaryCallSettings.Builder deleteFeedSettings() { - return getStubSettingsBuilder().deleteFeedSettings(); - } - /** Returns the builder for the settings used for calls to createFeed. */ public UnaryCallSettings.Builder createFeedSettings() { return getStubSettingsBuilder().createFeedSettings(); @@ -212,6 +209,11 @@ public UnaryCallSettings.Builder updateFeedSettings() { return getStubSettingsBuilder().updateFeedSettings(); } + /** Returns the builder for the settings used for calls to deleteFeed. */ + public UnaryCallSettings.Builder deleteFeedSettings() { + return getStubSettingsBuilder().deleteFeedSettings(); + } + @Override public AssetServiceSettings build() throws IOException { return new AssetServiceSettings(this); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/package-info.java index 1a798323b..b09af0ea3 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/package-info.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -15,26 +15,15 @@ */ /** - * A client to Cloud Asset API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

================== AssetServiceClient ================== + *

======================= AssetServiceClient ======================= * *

Service Description: Asset service definition. * *

Sample for AssetServiceClient: - * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
- *   assetServiceClient.deleteFeed(name);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.asset.v1p2beta1; import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStub.java index 68486c0bb..3e7a69cf0 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.asset.v1p2beta1.CreateFeedRequest; @@ -28,20 +28,15 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Cloud Asset API. + * Base stub class for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AssetServiceStub implements BackgroundResource { - public UnaryCallable deleteFeedCallable() { - throw new UnsupportedOperationException("Not implemented: deleteFeedCallable()"); - } - public UnaryCallable createFeedCallable() { throw new UnsupportedOperationException("Not implemented: createFeedCallable()"); } @@ -58,6 +53,10 @@ public UnaryCallable updateFeedCallable() { throw new UnsupportedOperationException("Not implemented: updateFeedCallable()"); } + public UnaryCallable deleteFeedCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFeedCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java index 387920a6b..bcd27544f 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1.stub; import com.google.api.core.ApiFunction; @@ -47,7 +48,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceStub}. * @@ -62,39 +63,35 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteFeed to 30 seconds: + *

For example, to set the total timeout of createFeed to 30 seconds: * - *

- * 
+ * 
{@code
  * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
  *     AssetServiceStubSettings.newBuilder();
  * assetServiceSettingsBuilder
- *     .deleteFeedSettings()
+ *     .createFeedSettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.deleteFeedSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .createFeedSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - private final UnaryCallSettings deleteFeedSettings; private final UnaryCallSettings createFeedSettings; private final UnaryCallSettings getFeedSettings; private final UnaryCallSettings listFeedsSettings; private final UnaryCallSettings updateFeedSettings; - - /** Returns the object with the settings used for calls to deleteFeed. */ - public UnaryCallSettings deleteFeedSettings() { - return deleteFeedSettings; - } + private final UnaryCallSettings deleteFeedSettings; /** Returns the object with the settings used for calls to createFeed. */ public UnaryCallSettings createFeedSettings() { @@ -116,16 +113,21 @@ public UnaryCallSettings updateFeedSettings() { return updateFeedSettings; } + /** Returns the object with the settings used for calls to deleteFeed. */ + public UnaryCallSettings deleteFeedSettings() { + return deleteFeedSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public AssetServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAssetServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -185,37 +187,34 @@ public Builder toBuilder() { protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - deleteFeedSettings = settingsBuilder.deleteFeedSettings().build(); createFeedSettings = settingsBuilder.createFeedSettings().build(); getFeedSettings = settingsBuilder.getFeedSettings().build(); listFeedsSettings = settingsBuilder.listFeedsSettings().build(); updateFeedSettings = settingsBuilder.updateFeedSettings().build(); + deleteFeedSettings = settingsBuilder.deleteFeedSettings().build(); } /** Builder for AssetServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - - private final UnaryCallSettings.Builder deleteFeedSettings; private final UnaryCallSettings.Builder createFeedSettings; private final UnaryCallSettings.Builder getFeedSettings; private final UnaryCallSettings.Builder listFeedsSettings; private final UnaryCallSettings.Builder updateFeedSettings; - + private final UnaryCallSettings.Builder deleteFeedSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -226,76 +225,83 @@ public static class Builder extends StubSettings.Builder>of( - deleteFeedSettings, createFeedSettings, getFeedSettings, listFeedsSettings, - updateFeedSettings); - + updateFeedSettings, + deleteFeedSettings); initDefaults(this); } + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + createFeedSettings = settings.createFeedSettings.toBuilder(); + getFeedSettings = settings.getFeedSettings.toBuilder(); + listFeedsSettings = settings.listFeedsSettings.toBuilder(); + updateFeedSettings = settings.updateFeedSettings.toBuilder(); + deleteFeedSettings = settings.deleteFeedSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createFeedSettings, + getFeedSettings, + listFeedsSettings, + updateFeedSettings, + deleteFeedSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - - builder - .deleteFeedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - builder .createFeedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getFeedSettings() @@ -309,31 +315,18 @@ private static Builder initDefaults(Builder builder) { builder .updateFeedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - - return builder; - } + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - protected Builder(AssetServiceStubSettings settings) { - super(settings); - - deleteFeedSettings = settings.deleteFeedSettings.toBuilder(); - createFeedSettings = settings.createFeedSettings.toBuilder(); - getFeedSettings = settings.getFeedSettings.toBuilder(); - listFeedsSettings = settings.listFeedsSettings.toBuilder(); - updateFeedSettings = settings.updateFeedSettings.toBuilder(); + builder + .deleteFeedSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - unaryMethodSettingsBuilders = - ImmutableList.>of( - deleteFeedSettings, - createFeedSettings, - getFeedSettings, - listFeedsSettings, - updateFeedSettings); + return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -349,11 +342,6 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to deleteFeed. */ - public UnaryCallSettings.Builder deleteFeedSettings() { - return deleteFeedSettings; - } - /** Returns the builder for the settings used for calls to createFeed. */ public UnaryCallSettings.Builder createFeedSettings() { return createFeedSettings; @@ -374,6 +362,11 @@ public UnaryCallSettings.Builder updateFeedSettings() { return updateFeedSettings; } + /** Returns the builder for the settings used for calls to deleteFeed. */ + public UnaryCallSettings.Builder deleteFeedSettings() { + return deleteFeedSettings; + } + @Override public AssetServiceStubSettings build() throws IOException { return new AssetServiceStubSettings(this); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceCallableFactory.java index 0900e6986..542d013fe 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceCallableFactory.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Cloud Asset API. + * gRPC callable factory implementation for the AssetService service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceStub.java index e22835979..43007ce0d 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -31,6 +31,7 @@ import com.google.cloud.asset.v1p2beta1.ListFeedsResponse; import com.google.cloud.asset.v1p2beta1.UpdateFeedRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -39,23 +40,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Cloud Asset API. + * gRPC stub implementation for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAssetServiceStub extends AssetServiceStub { - - private static final MethodDescriptor deleteFeedMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.asset.v1p2beta1.AssetService/DeleteFeed") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteFeedRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); private static final MethodDescriptor createFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -63,6 +55,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) .build(); + private static final MethodDescriptor getFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -70,6 +63,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(GetFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) .build(); + private static final MethodDescriptor listFeedsMethodDescriptor = MethodDescriptor.newBuilder() @@ -78,6 +72,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(ListFeedsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListFeedsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor updateFeedMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -86,14 +81,22 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; + private static final MethodDescriptor deleteFeedMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1p2beta1.AssetService/DeleteFeed") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteFeedRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); - private final UnaryCallable deleteFeedCallable; private final UnaryCallable createFeedCallable; private final UnaryCallable getFeedCallable; private final UnaryCallable listFeedsCallable; private final UnaryCallable updateFeedCallable; + private final UnaryCallable deleteFeedCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) @@ -132,20 +135,8 @@ protected GrpcAssetServiceStub( GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings deleteFeedTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteFeedMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteFeedRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); GrpcCallSettings createFeedTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createFeedMethodDescriptor) @@ -198,10 +189,20 @@ public Map extract(UpdateFeedRequest request) { } }) .build(); + GrpcCallSettings deleteFeedTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFeedMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteFeedRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); - this.deleteFeedCallable = - callableFactory.createUnaryCallable( - deleteFeedTransportSettings, settings.deleteFeedSettings(), clientContext); this.createFeedCallable = callableFactory.createUnaryCallable( createFeedTransportSettings, settings.createFeedSettings(), clientContext); @@ -214,12 +215,16 @@ public Map extract(UpdateFeedRequest request) { this.updateFeedCallable = callableFactory.createUnaryCallable( updateFeedTransportSettings, settings.updateFeedSettings(), clientContext); + this.deleteFeedCallable = + callableFactory.createUnaryCallable( + deleteFeedTransportSettings, settings.deleteFeedSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable deleteFeedCallable() { - return deleteFeedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable createFeedCallable() { @@ -238,6 +243,10 @@ public UnaryCallable updateFeedCallable() { return updateFeedCallable; } + public UnaryCallable deleteFeedCallable() { + return deleteFeedCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceClient.java index 406cca26c..0e97b14ca 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1; import com.google.api.core.BetaApi; @@ -28,26 +29,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Asset service definition. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
- *   AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
- *     .setAnalysisQuery(analysisQuery)
- *     .build();
- *   AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the assetServiceClient object to clean up resources such + *

Note: close() needs to be called on the AssetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -75,30 +64,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; @@ -119,7 +104,7 @@ public static final AssetServiceClient create(AssetServiceSettings settings) thr /** * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use AssetServiceSettings}. + * for advanced usage - prefer using create(AssetServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AssetServiceClient create(AssetServiceStub stub) { @@ -157,65 +142,58 @@ public AssetServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Analyzes IAM policies based on the specified request. Returns a list of + * [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the + * request. + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest request) { + return analyzeIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Analyzes IAM policies based on the specified request. Returns a list of + * [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the + * request. + * + *

Sample code: + */ + public final UnaryCallable + analyzeIamPolicyCallable() { + return stub.analyzeIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports IAM policy analysis based on the specified request. This API implements the * [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep track of * the export. The metadata contains the request to help callers to map responses to requests. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
-   *   ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   ExportIamPolicyAnalysisResponse response = assetServiceClient.exportIamPolicyAnalysisAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture exportIamPolicyAnalysisAsync(ExportIamPolicyAnalysisRequest request) { return exportIamPolicyAnalysisOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports IAM policy analysis based on the specified request. This API implements the * [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep track of * the export. The metadata contains the request to help callers to map responses to requests. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
-   *   ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   OperationFuture<ExportIamPolicyAnalysisResponse, ExportIamPolicyAnalysisRequest> future = assetServiceClient.exportIamPolicyAnalysisOperationCallable().futureCall(request);
-   *   // Do something
-   *   ExportIamPolicyAnalysisResponse response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable< ExportIamPolicyAnalysisRequest, ExportIamPolicyAnalysisResponse, @@ -224,83 +202,19 @@ public final OperationsClient getOperationsClient() { return stub.exportIamPolicyAnalysisOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports IAM policy analysis based on the specified request. This API implements the * [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep track of * the export. The metadata contains the request to help callers to map responses to requests. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build();
-   *   ExportIamPolicyAnalysisRequest request = ExportIamPolicyAnalysisRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .setOutputConfig(outputConfig)
-   *     .build();
-   *   ApiFuture<Operation> future = assetServiceClient.exportIamPolicyAnalysisCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable exportIamPolicyAnalysisCallable() { return stub.exportIamPolicyAnalysisCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Analyzes IAM policies based on the specified request. Returns a list of - * [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the - * request. - * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .build();
-   *   AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest request) { - return analyzeIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Analyzes IAM policies based on the specified request. Returns a list of - * [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the - * request. - * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
-   *   AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
-   *     .setAnalysisQuery(analysisQuery)
-   *     .build();
-   *   ApiFuture<AnalyzeIamPolicyResponse> future = assetServiceClient.analyzeIamPolicyCallable().futureCall(request);
-   *   // Do something
-   *   AnalyzeIamPolicyResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - analyzeIamPolicyCallable() { - return stub.analyzeIamPolicyCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceSettings.java index 5d804a218..5bb520423 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1; import com.google.api.core.ApiFunction; @@ -32,7 +33,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceClient}. * @@ -49,23 +50,29 @@ * *

For example, to set the total timeout of analyzeIamPolicy to 30 seconds: * - *

- * 
- * AssetServiceSettings.Builder assetServiceSettingsBuilder =
- *     AssetServiceSettings.newBuilder();
+ * 
{@code
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
  * assetServiceSettingsBuilder
  *     .analyzeIamPolicySettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.analyzeIamPolicySettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .analyzeIamPolicySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to analyzeIamPolicy. */ + public UnaryCallSettings + analyzeIamPolicySettings() { + return ((AssetServiceStubSettings) getStubSettings()).analyzeIamPolicySettings(); + } + /** Returns the object with the settings used for calls to exportIamPolicyAnalysis. */ public UnaryCallSettings exportIamPolicyAnalysisSettings() { @@ -73,8 +80,6 @@ public class AssetServiceSettings extends ClientSettings { } /** Returns the object with the settings used for calls to exportIamPolicyAnalysis. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings< ExportIamPolicyAnalysisRequest, ExportIamPolicyAnalysisResponse, @@ -84,12 +89,6 @@ public class AssetServiceSettings extends ClientSettings { .exportIamPolicyAnalysisOperationSettings(); } - /** Returns the object with the settings used for calls to analyzeIamPolicy. */ - public UnaryCallSettings - analyzeIamPolicySettings() { - return ((AssetServiceStubSettings) getStubSettings()).analyzeIamPolicySettings(); - } - public static final AssetServiceSettings create(AssetServiceStubSettings stub) throws IOException { return new AssetServiceSettings.Builder(stub.toBuilder()).build(); @@ -150,18 +149,15 @@ protected AssetServiceSettings(Builder settingsBuilder) throws IOException { /** Builder for AssetServiceSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AssetServiceStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AssetServiceStubSettings.newBuilder()); - } - protected Builder(AssetServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -170,11 +166,15 @@ protected Builder(AssetServiceStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { return ((AssetServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -187,6 +187,12 @@ public Builder applyToAllUnaryMethods( return this; } + /** Returns the builder for the settings used for calls to analyzeIamPolicy. */ + public UnaryCallSettings.Builder + analyzeIamPolicySettings() { + return getStubSettingsBuilder().analyzeIamPolicySettings(); + } + /** Returns the builder for the settings used for calls to exportIamPolicyAnalysis. */ public UnaryCallSettings.Builder exportIamPolicyAnalysisSettings() { @@ -194,8 +200,6 @@ public Builder applyToAllUnaryMethods( } /** Returns the builder for the settings used for calls to exportIamPolicyAnalysis. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder< ExportIamPolicyAnalysisRequest, ExportIamPolicyAnalysisResponse, @@ -204,12 +208,6 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().exportIamPolicyAnalysisOperationSettings(); } - /** Returns the builder for the settings used for calls to analyzeIamPolicy. */ - public UnaryCallSettings.Builder - analyzeIamPolicySettings() { - return getStubSettingsBuilder().analyzeIamPolicySettings(); - } - @Override public AssetServiceSettings build() throws IOException { return new AssetServiceSettings(this); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/package-info.java index 1cf911905..c5f6b23c4 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/package-info.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -15,29 +15,15 @@ */ /** - * A client to Cloud Asset API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

================== AssetServiceClient ================== + *

======================= AssetServiceClient ======================= * *

Service Description: Asset service definition. * *

Sample for AssetServiceClient: - * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build();
- *   AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder()
- *     .setAnalysisQuery(analysisQuery)
- *     .build();
- *   AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.asset.v1p4beta1; import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStub.java index 78a7284fd..d42f0adfd 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -27,22 +27,24 @@ import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Cloud Asset API. + * Base stub class for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AssetServiceStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable + analyzeIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: analyzeIamPolicyCallable()"); + } + public OperationCallable< ExportIamPolicyAnalysisRequest, ExportIamPolicyAnalysisResponse, @@ -57,11 +59,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: exportIamPolicyAnalysisCallable()"); } - public UnaryCallable - analyzeIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: analyzeIamPolicyCallable()"); - } - @Override public abstract void close(); } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java index 35994ac81..544eab3ac 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1.stub; import com.google.api.core.ApiFunction; @@ -48,7 +49,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceStub}. * @@ -65,27 +66,30 @@ * *

For example, to set the total timeout of analyzeIamPolicy to 30 seconds: * - *

- * 
+ * 
{@code
  * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
  *     AssetServiceStubSettings.newBuilder();
  * assetServiceSettingsBuilder
  *     .analyzeIamPolicySettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.analyzeIamPolicySettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .analyzeIamPolicySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private final UnaryCallSettings + analyzeIamPolicySettings; private final UnaryCallSettings exportIamPolicyAnalysisSettings; private final OperationCallSettings< @@ -93,8 +97,12 @@ public class AssetServiceStubSettings extends StubSettings exportIamPolicyAnalysisOperationSettings; - private final UnaryCallSettings - analyzeIamPolicySettings; + + /** Returns the object with the settings used for calls to analyzeIamPolicy. */ + public UnaryCallSettings + analyzeIamPolicySettings() { + return analyzeIamPolicySettings; + } /** Returns the object with the settings used for calls to exportIamPolicyAnalysis. */ public UnaryCallSettings @@ -103,7 +111,6 @@ public class AssetServiceStubSettings extends StubSettings - analyzeIamPolicySettings() { - return analyzeIamPolicySettings; - } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public AssetServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAssetServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -187,16 +188,17 @@ public Builder toBuilder() { protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); + analyzeIamPolicySettings = settingsBuilder.analyzeIamPolicySettings().build(); exportIamPolicyAnalysisSettings = settingsBuilder.exportIamPolicyAnalysisSettings().build(); exportIamPolicyAnalysisOperationSettings = settingsBuilder.exportIamPolicyAnalysisOperationSettings().build(); - analyzeIamPolicySettings = settingsBuilder.analyzeIamPolicySettings().build(); } /** Builder for AssetServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - + private final UnaryCallSettings.Builder + analyzeIamPolicySettings; private final UnaryCallSettings.Builder exportIamPolicyAnalysisSettings; private final OperationCallSettings.Builder< @@ -204,9 +206,6 @@ public static class Builder extends StubSettings.Builder exportIamPolicyAnalysisOperationSettings; - private final UnaryCallSettings.Builder - analyzeIamPolicySettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -216,9 +215,8 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -238,8 +236,6 @@ public static class Builder extends StubSettings.Builder>of( - exportIamPolicyAnalysisSettings, analyzeIamPolicySettings); - + analyzeIamPolicySettings, exportIamPolicyAnalysisSettings); initDefaults(this); } + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + analyzeIamPolicySettings = settings.analyzeIamPolicySettings.toBuilder(); + exportIamPolicyAnalysisSettings = settings.exportIamPolicyAnalysisSettings.toBuilder(); + exportIamPolicyAnalysisOperationSettings = + settings.exportIamPolicyAnalysisOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + analyzeIamPolicySettings, exportIamPolicyAnalysisSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - - builder - .exportIamPolicyAnalysisSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - builder .analyzeIamPolicySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .exportIamPolicyAnalysisSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .exportIamPolicyAnalysisOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create( @@ -311,29 +319,16 @@ private static Builder initDefaults(Builder builder) { .setInitialRetryDelay(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(AssetServiceStubSettings settings) { - super(settings); - - exportIamPolicyAnalysisSettings = settings.exportIamPolicyAnalysisSettings.toBuilder(); - exportIamPolicyAnalysisOperationSettings = - settings.exportIamPolicyAnalysisOperationSettings.toBuilder(); - analyzeIamPolicySettings = settings.analyzeIamPolicySettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - exportIamPolicyAnalysisSettings, analyzeIamPolicySettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -349,6 +344,12 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } + /** Returns the builder for the settings used for calls to analyzeIamPolicy. */ + public UnaryCallSettings.Builder + analyzeIamPolicySettings() { + return analyzeIamPolicySettings; + } + /** Returns the builder for the settings used for calls to exportIamPolicyAnalysis. */ public UnaryCallSettings.Builder exportIamPolicyAnalysisSettings() { @@ -366,12 +367,6 @@ public Builder applyToAllUnaryMethods( return exportIamPolicyAnalysisOperationSettings; } - /** Returns the builder for the settings used for calls to analyzeIamPolicy. */ - public UnaryCallSettings.Builder - analyzeIamPolicySettings() { - return analyzeIamPolicySettings; - } - @Override public AssetServiceStubSettings build() throws IOException { return new AssetServiceStubSettings(this); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceCallableFactory.java index 06a952945..881f7cbdd 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceCallableFactory.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Cloud Asset API. + * gRPC callable factory implementation for the AssetService service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceStub.java index b55eb8077..c4903d044 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -38,26 +38,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Cloud Asset API. + * gRPC stub implementation for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAssetServiceStub extends AssetServiceStub { - - private static final MethodDescriptor - exportIamPolicyAnalysisMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.asset.v1p4beta1.AssetService/ExportIamPolicyAnalysis") - .setRequestMarshaller( - ProtoUtils.marshaller(ExportIamPolicyAnalysisRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); private static final MethodDescriptor analyzeIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() @@ -69,9 +57,19 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ProtoUtils.marshaller(AnalyzeIamPolicyResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; + private static final MethodDescriptor + exportIamPolicyAnalysisMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.asset.v1p4beta1.AssetService/ExportIamPolicyAnalysis") + .setRequestMarshaller( + ProtoUtils.marshaller(ExportIamPolicyAnalysisRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private final UnaryCallable + analyzeIamPolicyCallable; private final UnaryCallable exportIamPolicyAnalysisCallable; private final OperationCallable< @@ -79,9 +77,9 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ExportIamPolicyAnalysisResponse, ExportIamPolicyAnalysisRequest> exportIamPolicyAnalysisOperationCallable; - private final UnaryCallable - analyzeIamPolicyCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) @@ -122,14 +120,14 @@ protected GrpcAssetServiceStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings - exportIamPolicyAnalysisTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(exportIamPolicyAnalysisMethodDescriptor) + GrpcCallSettings + analyzeIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(analyzeIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(ExportIamPolicyAnalysisRequest request) { + public Map extract(AnalyzeIamPolicyRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); params.put( "analysis_query.parent", @@ -138,14 +136,14 @@ public Map extract(ExportIamPolicyAnalysisRequest request) { } }) .build(); - GrpcCallSettings - analyzeIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(analyzeIamPolicyMethodDescriptor) + GrpcCallSettings + exportIamPolicyAnalysisTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportIamPolicyAnalysisMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(AnalyzeIamPolicyRequest request) { + public Map extract(ExportIamPolicyAnalysisRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); params.put( "analysis_query.parent", @@ -155,6 +153,9 @@ public Map extract(AnalyzeIamPolicyRequest request) { }) .build(); + this.analyzeIamPolicyCallable = + callableFactory.createUnaryCallable( + analyzeIamPolicyTransportSettings, settings.analyzeIamPolicySettings(), clientContext); this.exportIamPolicyAnalysisCallable = callableFactory.createUnaryCallable( exportIamPolicyAnalysisTransportSettings, @@ -165,26 +166,19 @@ public Map extract(AnalyzeIamPolicyRequest request) { exportIamPolicyAnalysisTransportSettings, settings.exportIamPolicyAnalysisOperationSettings(), clientContext, - this.operationsStub); - this.analyzeIamPolicyCallable = - callableFactory.createUnaryCallable( - analyzeIamPolicyTransportSettings, settings.analyzeIamPolicySettings(), clientContext); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable< - ExportIamPolicyAnalysisRequest, - ExportIamPolicyAnalysisResponse, - ExportIamPolicyAnalysisRequest> - exportIamPolicyAnalysisOperationCallable() { - return exportIamPolicyAnalysisOperationCallable; + public UnaryCallable + analyzeIamPolicyCallable() { + return analyzeIamPolicyCallable; } public UnaryCallable @@ -192,9 +186,12 @@ public GrpcOperationsStub getOperationsStub() { return exportIamPolicyAnalysisCallable; } - public UnaryCallable - analyzeIamPolicyCallable() { - return analyzeIamPolicyCallable; + public OperationCallable< + ExportIamPolicyAnalysisRequest, + ExportIamPolicyAnalysisResponse, + ExportIamPolicyAnalysisRequest> + exportIamPolicyAnalysisOperationCallable() { + return exportIamPolicyAnalysisOperationCallable; } @Override diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java index 75dd57b21..cd34011d4 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1; import com.google.api.core.ApiFunction; @@ -33,30 +34,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Asset service definition. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   String parent = "";
- *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
- *     .setParent(parent)
- *     .build();
- *   ApiFuture<ListAssetsPagedResponse> future = assetServiceClient.listAssetsPagedCallable().futureCall(request);
- *   // Do something
- *   for (Asset element : future.get().iterateAll()) {
- *     // doThingsWith(element);
- *   }
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the assetServiceClient object to clean up resources such + *

Note: close() needs to be called on the AssetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -84,30 +69,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * AssetServiceSettings assetServiceSettings =
  *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AssetServiceClient assetServiceClient =
- *     AssetServiceClient.create(assetServiceSettings);
- * 
- * 
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; @@ -127,7 +108,7 @@ public static final AssetServiceClient create(AssetServiceSettings settings) thr /** * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use AssetServiceSettings}. + * for advanced usage - prefer using create(AssetServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AssetServiceClient create(AssetServiceStub stub) { @@ -159,24 +140,10 @@ public AssetServiceStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists assets with time and resource types and returns paged results in response. * - *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   for (Asset element : assetServiceClient.listAssets(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -184,56 +151,21 @@ public final ListAssetsPagedResponse listAssets(ListAssetsRequest request) { return listAssetsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists assets with time and resource types and returns paged results in response. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   ApiFuture<ListAssetsPagedResponse> future = assetServiceClient.listAssetsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Asset element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listAssetsPagedCallable() { return stub.listAssetsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists assets with time and resource types and returns paged results in response. * *

Sample code: - * - *


-   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
-   *   String parent = "";
-   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
-   *     .setParent(parent)
-   *     .build();
-   *   while (true) {
-   *     ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request);
-   *     for (Asset element : response.getAssetsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listAssetsCallable() { return stub.listAssetsCallable(); diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java index 97381e769..ab5eb79af 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1; import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; @@ -33,7 +34,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceClient}. * @@ -48,25 +49,25 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of listAssetsPagedCallable to 30 seconds: + *

For example, to set the total timeout of listAssets to 30 seconds: * - *

- * 
- * AssetServiceSettings.Builder assetServiceSettingsBuilder =
- *     AssetServiceSettings.newBuilder();
+ * 
{@code
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
  * assetServiceSettingsBuilder
  *     .listAssetsSettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.listAssetsSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .listAssetsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listAssets. */ public PagedCallSettings listAssetsSettings() { @@ -133,18 +134,15 @@ protected AssetServiceSettings(Builder settingsBuilder) throws IOException { /** Builder for AssetServiceSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AssetServiceStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AssetServiceStubSettings.newBuilder()); - } - protected Builder(AssetServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -153,11 +151,15 @@ protected Builder(AssetServiceStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { return ((AssetServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java index cdff7128a..36080a7b8 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -15,29 +15,15 @@ */ /** - * A client to Cloud Asset API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

================== AssetServiceClient ================== + *

======================= AssetServiceClient ======================= * *

Service Description: Asset service definition. * *

Sample for AssetServiceClient: - * - *

- * 
- * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
- *   String parent = "";
- *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
- *     .setParent(parent)
- *     .build();
- *   ListAssetsPagedResponse response = assetServiceClient.listAssetsPagedCallable(request);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.asset.v1p5beta1; import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java index 8fc2992a7..d62db04da 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,25 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1.stub; import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.asset.v1p5beta1.ListAssetsRequest; import com.google.cloud.asset.v1p5beta1.ListAssetsResponse; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Cloud Asset API. + * Base stub class for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AssetServiceStub implements BackgroundResource { public UnaryCallable listAssetsPagedCallable() { diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java index 3598ea9a5..c39e0bee1 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1.stub; import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; @@ -51,7 +52,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AssetServiceStub}. * @@ -66,24 +67,25 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of listAssetsPagedCallable to 30 seconds: + *

For example, to set the total timeout of listAssets to 30 seconds: * - *

- * 
+ * 
{@code
  * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
  *     AssetServiceStubSettings.newBuilder();
  * assetServiceSettingsBuilder
  *     .listAssetsSettings()
  *     .setRetrySettings(
- *         assetServiceSettingsBuilder.listAssetsSettings().getRetrySettings().toBuilder()
+ *         assetServiceSettingsBuilder
+ *             .listAssetsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -92,6 +94,59 @@ public class AssetServiceStubSettings extends StubSettings listAssetsSettings; + private static final PagedListDescriptor + LIST_ASSETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAssetsRequest injectToken(ListAssetsRequest payload, String token) { + return ListAssetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAssetsRequest injectPageSize(ListAssetsRequest payload, int pageSize) { + return ListAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAssetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAssetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAssetsResponse payload) { + return payload.getAssetsList() == null + ? ImmutableList.of() + : payload.getAssetsList(); + } + }; + + private static final PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + LIST_ASSETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAssetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ASSETS_PAGE_STR_DESC, request, context); + return ListAssetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listAssets. */ public PagedCallSettings listAssetsSettings() { @@ -104,10 +159,10 @@ public AssetServiceStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAssetServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -170,67 +225,12 @@ protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { listAssetsSettings = settingsBuilder.listAssetsSettings().build(); } - private static final PagedListDescriptor - LIST_ASSETS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListAssetsRequest injectToken(ListAssetsRequest payload, String token) { - return ListAssetsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListAssetsRequest injectPageSize(ListAssetsRequest payload, int pageSize) { - return ListAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListAssetsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListAssetsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListAssetsResponse payload) { - return payload.getAssetsList() != null - ? payload.getAssetsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> - LIST_ASSETS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListAssetsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ASSETS_PAGE_STR_DESC, request, context); - return ListAssetsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for AssetServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> listAssetsSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -238,11 +238,10 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_0_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -256,17 +255,17 @@ public static class Builder extends StubSettings.Builder>of(listAssetsSettings); - initDefaults(this); } + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + listAssetsSettings = settings.listAssetsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listAssetsSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listAssetsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(AssetServiceStubSettings settings) { - super(settings); - - listAssetsSettings = settings.listAssetsSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of(listAssetsSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java index be2d2af03..a1ac5936e 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Cloud Asset API. + * gRPC callable factory implementation for the AssetService service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java index fd740561d..45d29d0d2 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1.stub; import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -28,6 +28,7 @@ import com.google.cloud.asset.v1p5beta1.ListAssetsRequest; import com.google.cloud.asset.v1p5beta1.ListAssetsResponse; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -35,16 +36,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Cloud Asset API. + * gRPC stub implementation for the AssetService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAssetServiceStub extends AssetServiceStub { - private static final MethodDescriptor listAssetsMethodDescriptor = MethodDescriptor.newBuilder() @@ -54,11 +53,11 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(ListAssetsResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listAssetsCallable; private final UnaryCallable listAssetsPagedCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) @@ -97,6 +96,7 @@ protected GrpcAssetServiceStub( GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listAssetsTransportSettings = GrpcCallSettings.newBuilder() @@ -119,17 +119,22 @@ public Map extract(ListAssetsRequest request) { callableFactory.createPagedCallable( listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listAssetsPagedCallable() { - return listAssetsPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listAssetsCallable() { return listAssetsCallable; } + public UnaryCallable listAssetsPagedCallable() { + return listAssetsPagedCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java index 8c7f7882f..a85f37158 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; @@ -30,16 +31,18 @@ import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; -import io.grpc.Status; +import com.google.protobuf.Timestamp; +import com.google.type.Expr; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Objects; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -47,31 +50,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AssetServiceClientTest { - private static MockAssetService mockAssetService; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AssetServiceClient client; private LocalChannelProvider channelProvider; + private static MockAssetService mockAssetService; @BeforeClass public static void startStaticServer() { mockAssetService = new MockAssetService(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AssetServiceSettings settings = AssetServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -86,9 +89,13 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") public void exportAssetsTest() throws Exception { - ExportAssetsResponse expectedResponse = ExportAssetsResponse.newBuilder().build(); + ExportAssetsResponse expectedResponse = + ExportAssetsResponse.newBuilder() + .setReadTime(Timestamp.newBuilder().build()) + .setOutputConfig(OutputConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); Operation resultOperation = Operation.newBuilder() .setName("exportAssetsTest") @@ -97,12 +104,12 @@ public void exportAssetsTest() throws Exception { .build(); mockAssetService.addResponse(resultOperation); - String parent = "parent-995424086"; - OutputConfig outputConfig = OutputConfig.newBuilder().build(); ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent(parent.toString()) - .setOutputConfig(outputConfig) + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setOutputConfig(OutputConfig.newBuilder().build()) .build(); ExportAssetsResponse actualResponse = client.exportAssetsAsync(request).get(); @@ -110,10 +117,13 @@ public void exportAssetsTest() throws Exception { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ExportAssetsRequest actualRequest = (ExportAssetsRequest) actualRequests.get(0); + ExportAssetsRequest actualRequest = ((ExportAssetsRequest) actualRequests.get(0)); - Assert.assertEquals(Objects.toString(parent), Objects.toString(actualRequest.getParent())); - Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertEquals(request.getAssetTypesList(), actualRequest.getAssetTypesList()); + Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -121,39 +131,41 @@ public void exportAssetsTest() throws Exception { } @Test - @SuppressWarnings("all") public void exportAssetsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - String parent = "parent-995424086"; - OutputConfig outputConfig = OutputConfig.newBuilder().build(); ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent(parent.toString()) - .setOutputConfig(outputConfig) + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setOutputConfig(OutputConfig.newBuilder().build()) .build(); - client.exportAssetsAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void batchGetAssetsHistoryTest() { + public void batchGetAssetsHistoryTest() throws Exception { BatchGetAssetsHistoryResponse expectedResponse = - BatchGetAssetsHistoryResponse.newBuilder().build(); + BatchGetAssetsHistoryResponse.newBuilder() + .addAllAssets(new ArrayList()) + .build(); mockAssetService.addResponse(expectedResponse); - String parent = "parent-995424086"; BatchGetAssetsHistoryRequest request = - BatchGetAssetsHistoryRequest.newBuilder().setParent(parent.toString()).build(); + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .setReadTimeWindow(TimeWindow.newBuilder().build()) + .build(); BatchGetAssetsHistoryResponse actualResponse = client.batchGetAssetsHistory(request); Assert.assertEquals(expectedResponse, actualResponse); @@ -161,9 +173,12 @@ public void batchGetAssetsHistoryTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); BatchGetAssetsHistoryRequest actualRequest = - (BatchGetAssetsHistoryRequest) actualRequests.get(0); + ((BatchGetAssetsHistoryRequest) actualRequests.get(0)); - Assert.assertEquals(Objects.toString(parent), Objects.toString(actualRequest.getParent())); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getAssetNamesList(), actualRequest.getAssetNamesList()); + Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); + Assert.assertEquals(request.getReadTimeWindow(), actualRequest.getReadTimeWindow()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -171,28 +186,34 @@ public void batchGetAssetsHistoryTest() { } @Test - @SuppressWarnings("all") public void batchGetAssetsHistoryExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - String parent = "parent-995424086"; BatchGetAssetsHistoryRequest request = - BatchGetAssetsHistoryRequest.newBuilder().setParent(parent.toString()).build(); - + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .setReadTimeWindow(TimeWindow.newBuilder().build()) + .build(); client.batchGetAssetsHistory(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createFeedTest() { - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed expectedResponse = Feed.newBuilder().setName(name.toString()).build(); + public void createFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); String parent = "parent-995424086"; @@ -202,7 +223,7 @@ public void createFeedTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateFeedRequest actualRequest = (CreateFeedRequest) actualRequests.get(0); + CreateFeedRequest actualRequest = ((CreateFeedRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( @@ -212,26 +233,29 @@ public void createFeedTest() { } @Test - @SuppressWarnings("all") public void createFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String parent = "parent-995424086"; - client.createFeed(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getFeedTest() { - FeedName name2 = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed expectedResponse = Feed.newBuilder().setName(name2.toString()).build(); + public void getFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); @@ -241,9 +265,9 @@ public void getFeedTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetFeedRequest actualRequest = (GetFeedRequest) actualRequests.get(0); + GetFeedRequest actualRequest = ((GetFeedRequest) actualRequests.get(0)); - Assert.assertEquals(name, FeedName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -251,25 +275,65 @@ public void getFeedTest() { } @Test - @SuppressWarnings("all") public void getFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + client.getFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeedTest2() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + String name = "name3373707"; + + Feed actualResponse = client.getFeed(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFeedRequest actualRequest = ((GetFeedRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void getFeedExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String name = "name3373707"; client.getFeed(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listFeedsTest() { - ListFeedsResponse expectedResponse = ListFeedsResponse.newBuilder().build(); + public void listFeedsTest() throws Exception { + ListFeedsResponse expectedResponse = + ListFeedsResponse.newBuilder().addAllFeeds(new ArrayList()).build(); mockAssetService.addResponse(expectedResponse); String parent = "parent-995424086"; @@ -279,7 +343,7 @@ public void listFeedsTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListFeedsRequest actualRequest = (ListFeedsRequest) actualRequests.get(0); + ListFeedsRequest actualRequest = ((ListFeedsRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( @@ -289,26 +353,29 @@ public void listFeedsTest() { } @Test - @SuppressWarnings("all") public void listFeedsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String parent = "parent-995424086"; - client.listFeeds(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateFeedTest() { - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed expectedResponse = Feed.newBuilder().setName(name.toString()).build(); + public void updateFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); Feed feed = Feed.newBuilder().build(); @@ -318,7 +385,7 @@ public void updateFeedTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateFeedRequest actualRequest = (UpdateFeedRequest) actualRequests.get(0); + UpdateFeedRequest actualRequest = ((UpdateFeedRequest) actualRequests.get(0)); Assert.assertEquals(feed, actualRequest.getFeed()); Assert.assertTrue( @@ -328,24 +395,21 @@ public void updateFeedTest() { } @Test - @SuppressWarnings("all") public void updateFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { Feed feed = Feed.newBuilder().build(); - client.updateFeed(feed); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteFeedTest() { + public void deleteFeedTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockAssetService.addResponse(expectedResponse); @@ -355,9 +419,9 @@ public void deleteFeedTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteFeedRequest actualRequest = (DeleteFeedRequest) actualRequests.get(0); + DeleteFeedRequest actualRequest = ((DeleteFeedRequest) actualRequests.get(0)); - Assert.assertEquals(name, FeedName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -365,31 +429,60 @@ public void deleteFeedTest() { } @Test - @SuppressWarnings("all") public void deleteFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + client.deleteFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteFeedTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAssetService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteFeed(name); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFeedRequest actualRequest = ((DeleteFeedRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFeedExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + try { + String name = "name3373707"; client.deleteFeed(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void searchAllResourcesTest() { - String nextPageToken = ""; - ResourceSearchResult resultsElement = ResourceSearchResult.newBuilder().build(); - List results = Arrays.asList(resultsElement); + public void searchAllResourcesTest() throws Exception { + ResourceSearchResult responsesElement = ResourceSearchResult.newBuilder().build(); SearchAllResourcesResponse expectedResponse = SearchAllResourcesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllResults(results) + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) .build(); mockAssetService.addResponse(expectedResponse); @@ -401,12 +494,13 @@ public void searchAllResourcesTest() { client.searchAllResources(scope, query, assetTypes); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SearchAllResourcesRequest actualRequest = (SearchAllResourcesRequest) actualRequests.get(0); + SearchAllResourcesRequest actualRequest = ((SearchAllResourcesRequest) actualRequests.get(0)); Assert.assertEquals(scope, actualRequest.getScope()); Assert.assertEquals(query, actualRequest.getQuery()); @@ -418,33 +512,28 @@ public void searchAllResourcesTest() { } @Test - @SuppressWarnings("all") public void searchAllResourcesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String scope = "scope109264468"; String query = "query107944136"; List assetTypes = new ArrayList<>(); - client.searchAllResources(scope, query, assetTypes); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void searchAllIamPoliciesTest() { - String nextPageToken = ""; - IamPolicySearchResult resultsElement = IamPolicySearchResult.newBuilder().build(); - List results = Arrays.asList(resultsElement); + public void searchAllIamPoliciesTest() throws Exception { + IamPolicySearchResult responsesElement = IamPolicySearchResult.newBuilder().build(); SearchAllIamPoliciesResponse expectedResponse = SearchAllIamPoliciesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllResults(results) + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) .build(); mockAssetService.addResponse(expectedResponse); @@ -454,12 +543,14 @@ public void searchAllIamPoliciesTest() { SearchAllIamPoliciesPagedResponse pagedListResponse = client.searchAllIamPolicies(scope, query); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SearchAllIamPoliciesRequest actualRequest = (SearchAllIamPoliciesRequest) actualRequests.get(0); + SearchAllIamPoliciesRequest actualRequest = + ((SearchAllIamPoliciesRequest) actualRequests.get(0)); Assert.assertEquals(scope, actualRequest.getScope()); Assert.assertEquals(query, actualRequest.getQuery()); @@ -470,42 +561,45 @@ public void searchAllIamPoliciesTest() { } @Test - @SuppressWarnings("all") public void searchAllIamPoliciesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String scope = "scope109264468"; String query = "query107944136"; - client.searchAllIamPolicies(scope, query); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void analyzeIamPolicyTest() { - boolean fullyExplored = true; + public void analyzeIamPolicyTest() throws Exception { AnalyzeIamPolicyResponse expectedResponse = - AnalyzeIamPolicyResponse.newBuilder().setFullyExplored(fullyExplored).build(); + AnalyzeIamPolicyResponse.newBuilder() + .addAllServiceAccountImpersonationAnalysis( + new ArrayList()) + .setFullyExplored(true) + .build(); mockAssetService.addResponse(expectedResponse); - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); AnalyzeIamPolicyRequest request = - AnalyzeIamPolicyRequest.newBuilder().setAnalysisQuery(analysisQuery).build(); + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setExecutionTimeout(Duration.newBuilder().build()) + .build(); AnalyzeIamPolicyResponse actualResponse = client.analyzeIamPolicy(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - AnalyzeIamPolicyRequest actualRequest = (AnalyzeIamPolicyRequest) actualRequests.get(0); + AnalyzeIamPolicyRequest actualRequest = ((AnalyzeIamPolicyRequest) actualRequests.get(0)); - Assert.assertEquals(analysisQuery, actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getAnalysisQuery(), actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getExecutionTimeout(), actualRequest.getExecutionTimeout()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -513,25 +607,24 @@ public void analyzeIamPolicyTest() { } @Test - @SuppressWarnings("all") public void analyzeIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); AnalyzeIamPolicyRequest request = - AnalyzeIamPolicyRequest.newBuilder().setAnalysisQuery(analysisQuery).build(); - + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setExecutionTimeout(Duration.newBuilder().build()) + .build(); client.analyzeIamPolicy(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void analyzeIamPolicyLongrunningTest() throws Exception { AnalyzeIamPolicyLongrunningResponse expectedResponse = AnalyzeIamPolicyLongrunningResponse.newBuilder().build(); @@ -543,12 +636,10 @@ public void analyzeIamPolicyLongrunningTest() throws Exception { .build(); mockAssetService.addResponse(resultOperation); - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); - IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build(); AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() - .setAnalysisQuery(analysisQuery) - .setOutputConfig(outputConfig) + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); AnalyzeIamPolicyLongrunningResponse actualResponse = @@ -558,10 +649,10 @@ public void analyzeIamPolicyLongrunningTest() throws Exception { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); AnalyzeIamPolicyLongrunningRequest actualRequest = - (AnalyzeIamPolicyLongrunningRequest) actualRequests.get(0); + ((AnalyzeIamPolicyLongrunningRequest) actualRequests.get(0)); - Assert.assertEquals(analysisQuery, actualRequest.getAnalysisQuery()); - Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertEquals(request.getAnalysisQuery(), actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -569,26 +660,21 @@ public void analyzeIamPolicyLongrunningTest() throws Exception { } @Test - @SuppressWarnings("all") public void analyzeIamPolicyLongrunningExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); - IamPolicyAnalysisOutputConfig outputConfig = - IamPolicyAnalysisOutputConfig.newBuilder().build(); AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() - .setAnalysisQuery(analysisQuery) - .setOutputConfig(outputConfig) + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); - client.analyzeIamPolicyLongrunningAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetService.java index 65dfd2cdc..140e701a9 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetService.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetService.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetService implements MockGrpcService { private final MockAssetServiceImpl serviceImpl; diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java index 5b3b4dd64..80848ac73 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetServiceImpl extends AssetServiceImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void exportAssets( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -80,10 +82,10 @@ public void batchGetAssetsHistory( Object response = responses.remove(); if (response instanceof BatchGetAssetsHistoryResponse) { requests.add(request); - responseObserver.onNext((BatchGetAssetsHistoryResponse) response); + responseObserver.onNext(((BatchGetAssetsHistoryResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -94,10 +96,10 @@ public void createFeed(CreateFeedRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Feed) { requests.add(request); - responseObserver.onNext((Feed) response); + responseObserver.onNext(((Feed) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void getFeed(GetFeedRequest request, StreamObserver responseObserve Object response = responses.remove(); if (response instanceof Feed) { requests.add(request); - responseObserver.onNext((Feed) response); + responseObserver.onNext(((Feed) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -123,10 +125,10 @@ public void listFeeds( Object response = responses.remove(); if (response instanceof ListFeedsResponse) { requests.add(request); - responseObserver.onNext((ListFeedsResponse) response); + responseObserver.onNext(((ListFeedsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -137,10 +139,10 @@ public void updateFeed(UpdateFeedRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Feed) { requests.add(request); - responseObserver.onNext((Feed) response); + responseObserver.onNext(((Feed) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -151,10 +153,10 @@ public void deleteFeed(DeleteFeedRequest request, StreamObserver response Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -167,10 +169,10 @@ public void searchAllResources( Object response = responses.remove(); if (response instanceof SearchAllResourcesResponse) { requests.add(request); - responseObserver.onNext((SearchAllResourcesResponse) response); + responseObserver.onNext(((SearchAllResourcesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -183,10 +185,10 @@ public void searchAllIamPolicies( Object response = responses.remove(); if (response instanceof SearchAllIamPoliciesResponse) { requests.add(request); - responseObserver.onNext((SearchAllIamPoliciesResponse) response); + responseObserver.onNext(((SearchAllIamPoliciesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -198,10 +200,10 @@ public void analyzeIamPolicy( Object response = responses.remove(); if (response instanceof AnalyzeIamPolicyResponse) { requests.add(request); - responseObserver.onNext((AnalyzeIamPolicyResponse) response); + responseObserver.onNext(((AnalyzeIamPolicyResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -213,10 +215,10 @@ public void analyzeIamPolicyLongrunning( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/AssetServiceClientTest.java index 771e370f2..06e4efa6c 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/AssetServiceClientTest.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/AssetServiceClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1; import static com.google.cloud.asset.v1p1beta1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; @@ -27,13 +28,13 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,31 +42,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AssetServiceClientTest { - private static MockAssetService mockAssetService; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AssetServiceClient client; private LocalChannelProvider channelProvider; + private static MockAssetService mockAssetService; @BeforeClass public static void startStaticServer() { mockAssetService = new MockAssetService(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AssetServiceSettings settings = AssetServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -80,15 +81,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void searchAllResourcesTest() { - String nextPageToken = ""; - StandardResourceMetadata resultsElement = StandardResourceMetadata.newBuilder().build(); - List results = Arrays.asList(resultsElement); + public void searchAllResourcesTest() throws Exception { + StandardResourceMetadata responsesElement = StandardResourceMetadata.newBuilder().build(); SearchAllResourcesResponse expectedResponse = SearchAllResourcesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllResults(results) + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) .build(); mockAssetService.addResponse(expectedResponse); @@ -100,12 +98,13 @@ public void searchAllResourcesTest() { client.searchAllResources(scope, query, assetTypes); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SearchAllResourcesRequest actualRequest = (SearchAllResourcesRequest) actualRequests.get(0); + SearchAllResourcesRequest actualRequest = ((SearchAllResourcesRequest) actualRequests.get(0)); Assert.assertEquals(scope, actualRequest.getScope()); Assert.assertEquals(query, actualRequest.getQuery()); @@ -117,33 +116,28 @@ public void searchAllResourcesTest() { } @Test - @SuppressWarnings("all") public void searchAllResourcesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String scope = "scope109264468"; String query = "query107944136"; List assetTypes = new ArrayList<>(); - client.searchAllResources(scope, query, assetTypes); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void searchAllIamPoliciesTest() { - String nextPageToken = ""; - IamPolicySearchResult resultsElement = IamPolicySearchResult.newBuilder().build(); - List results = Arrays.asList(resultsElement); + public void searchAllIamPoliciesTest() throws Exception { + IamPolicySearchResult responsesElement = IamPolicySearchResult.newBuilder().build(); SearchAllIamPoliciesResponse expectedResponse = SearchAllIamPoliciesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllResults(results) + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) .build(); mockAssetService.addResponse(expectedResponse); @@ -153,12 +147,14 @@ public void searchAllIamPoliciesTest() { SearchAllIamPoliciesPagedResponse pagedListResponse = client.searchAllIamPolicies(scope, query); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SearchAllIamPoliciesRequest actualRequest = (SearchAllIamPoliciesRequest) actualRequests.get(0); + SearchAllIamPoliciesRequest actualRequest = + ((SearchAllIamPoliciesRequest) actualRequests.get(0)); Assert.assertEquals(scope, actualRequest.getScope()); Assert.assertEquals(query, actualRequest.getQuery()); @@ -169,19 +165,17 @@ public void searchAllIamPoliciesTest() { } @Test - @SuppressWarnings("all") public void searchAllIamPoliciesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String scope = "scope109264468"; String query = "query107944136"; - client.searchAllIamPolicies(scope, query); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetService.java index 2094aa2fb..564f47cbe 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetService.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetService.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetService implements MockGrpcService { private final MockAssetServiceImpl serviceImpl; diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetServiceImpl.java index 1fae3c553..ae2b93a27 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetServiceImpl.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetServiceImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p1beta1; import com.google.api.core.BetaApi; @@ -23,9 +24,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetServiceImpl extends AssetServiceImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void searchAllResources( Object response = responses.remove(); if (response instanceof SearchAllResourcesResponse) { requests.add(request); - responseObserver.onNext((SearchAllResourcesResponse) response); + responseObserver.onNext(((SearchAllResourcesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -79,10 +81,10 @@ public void searchAllIamPolicies( Object response = responses.remove(); if (response instanceof SearchAllIamPoliciesResponse) { requests.add(request); - responseObserver.onNext((SearchAllIamPoliciesResponse) response); + responseObserver.onNext(((SearchAllIamPoliciesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/AssetServiceClientTest.java index e336ec2e0..f6725be01 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/AssetServiceClientTest.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/AssetServiceClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1; import com.google.api.gax.core.NoCredentialsProvider; @@ -24,12 +25,13 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -37,31 +39,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AssetServiceClientTest { - private static MockAssetService mockAssetService; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AssetServiceClient client; private LocalChannelProvider channelProvider; + private static MockAssetService mockAssetService; @BeforeClass public static void startStaticServer() { mockAssetService = new MockAssetService(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AssetServiceSettings settings = AssetServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -76,20 +78,26 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void deleteFeedTest() { - Empty expectedResponse = Empty.newBuilder().build(); + public void createFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + String parent = "parent-995424086"; - client.deleteFeed(name); + Feed actualResponse = client.createFeed(parent); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteFeedRequest actualRequest = (DeleteFeedRequest) actualRequests.get(0); + CreateFeedRequest actualRequest = ((CreateFeedRequest) actualRequests.get(0)); - Assert.assertEquals(name, FeedName.parse(actualRequest.getName())); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -97,38 +105,40 @@ public void deleteFeedTest() { } @Test - @SuppressWarnings("all") - public void deleteFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + public void createFeedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - - client.deleteFeed(name); + String parent = "parent-995424086"; + client.createFeed(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createFeedTest() { - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed expectedResponse = Feed.newBuilder().setName(name.toString()).build(); + public void getFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); - String parent = "parent-995424086"; + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed actualResponse = client.createFeed(parent); + Feed actualResponse = client.getFeed(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateFeedRequest actualRequest = (CreateFeedRequest) actualRequests.get(0); + GetFeedRequest actualRequest = ((GetFeedRequest) actualRequests.get(0)); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -136,38 +146,40 @@ public void createFeedTest() { } @Test - @SuppressWarnings("all") - public void createFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + public void getFeedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - String parent = "parent-995424086"; - - client.createFeed(parent); + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + client.getFeed(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getFeedTest() { - FeedName name2 = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed expectedResponse = Feed.newBuilder().setName(name2.toString()).build(); + public void getFeedTest2() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + String name = "name3373707"; Feed actualResponse = client.getFeed(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetFeedRequest actualRequest = (GetFeedRequest) actualRequests.get(0); + GetFeedRequest actualRequest = ((GetFeedRequest) actualRequests.get(0)); - Assert.assertEquals(name, FeedName.parse(actualRequest.getName())); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -175,25 +187,23 @@ public void getFeedTest() { } @Test - @SuppressWarnings("all") - public void getFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + public void getFeedExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - + String name = "name3373707"; client.getFeed(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listFeedsTest() { - ListFeedsResponse expectedResponse = ListFeedsResponse.newBuilder().build(); + public void listFeedsTest() throws Exception { + ListFeedsResponse expectedResponse = + ListFeedsResponse.newBuilder().addAllFeeds(new ArrayList()).build(); mockAssetService.addResponse(expectedResponse); String parent = "parent-995424086"; @@ -203,7 +213,7 @@ public void listFeedsTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListFeedsRequest actualRequest = (ListFeedsRequest) actualRequests.get(0); + ListFeedsRequest actualRequest = ((ListFeedsRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( @@ -213,26 +223,28 @@ public void listFeedsTest() { } @Test - @SuppressWarnings("all") public void listFeedsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { String parent = "parent-995424086"; - client.listFeeds(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateFeedTest() { - FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); - Feed expectedResponse = Feed.newBuilder().setName(name.toString()).build(); + public void updateFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .build(); mockAssetService.addResponse(expectedResponse); Feed feed = Feed.newBuilder().build(); @@ -242,7 +254,7 @@ public void updateFeedTest() { List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateFeedRequest actualRequest = (UpdateFeedRequest) actualRequests.get(0); + UpdateFeedRequest actualRequest = ((UpdateFeedRequest) actualRequests.get(0)); Assert.assertEquals(feed, actualRequest.getFeed()); Assert.assertTrue( @@ -252,18 +264,84 @@ public void updateFeedTest() { } @Test - @SuppressWarnings("all") public void updateFeedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { Feed feed = Feed.newBuilder().build(); - client.updateFeed(feed); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. + } + } + + @Test + public void deleteFeedTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAssetService.addResponse(expectedResponse); + + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + + client.deleteFeed(name); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFeedRequest actualRequest = ((DeleteFeedRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFeedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + client.deleteFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteFeedTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAssetService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteFeed(name); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFeedRequest actualRequest = ((DeleteFeedRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFeedExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String name = "name3373707"; + client.deleteFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. } } } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetService.java index 80ad275ec..6df5f25f2 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetService.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetService.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetService implements MockGrpcService { private final MockAssetServiceImpl serviceImpl; diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetServiceImpl.java index 0be684751..f17f0fdb4 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetServiceImpl.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetServiceImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p2beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetServiceImpl extends AssetServiceImplBase { private List requests; private Queue responses; @@ -62,10 +64,10 @@ public void createFeed(CreateFeedRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Feed) { requests.add(request); - responseObserver.onNext((Feed) response); + responseObserver.onNext(((Feed) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -76,10 +78,10 @@ public void getFeed(GetFeedRequest request, StreamObserver responseObserve Object response = responses.remove(); if (response instanceof Feed) { requests.add(request); - responseObserver.onNext((Feed) response); + responseObserver.onNext(((Feed) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -91,10 +93,10 @@ public void listFeeds( Object response = responses.remove(); if (response instanceof ListFeedsResponse) { requests.add(request); - responseObserver.onNext((ListFeedsResponse) response); + responseObserver.onNext(((ListFeedsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -105,10 +107,10 @@ public void updateFeed(UpdateFeedRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Feed) { requests.add(request); - responseObserver.onNext((Feed) response); + responseObserver.onNext(((Feed) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -119,10 +121,10 @@ public void deleteFeed(DeleteFeedRequest request, StreamObserver response Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java index 68d2aa9a4..b1bc59ee0 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1; import com.google.api.gax.core.NoCredentialsProvider; @@ -26,13 +27,14 @@ import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -40,31 +42,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AssetServiceClientTest { - private static MockAssetService mockAssetService; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AssetServiceClient client; private LocalChannelProvider channelProvider; + private static MockAssetService mockAssetService; @BeforeClass public static void startStaticServer() { mockAssetService = new MockAssetService(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AssetServiceSettings settings = AssetServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -79,37 +81,30 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void exportIamPolicyAnalysisTest() throws Exception { - ExportIamPolicyAnalysisResponse expectedResponse = - ExportIamPolicyAnalysisResponse.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("exportIamPolicyAnalysisTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + public void analyzeIamPolicyTest() throws Exception { + AnalyzeIamPolicyResponse expectedResponse = + AnalyzeIamPolicyResponse.newBuilder() + .addAllServiceAccountImpersonationAnalysis( + new ArrayList()) + .setFullyExplored(true) + .addAllNonCriticalErrors(new ArrayList()) .build(); - mockAssetService.addResponse(resultOperation); + mockAssetService.addResponse(expectedResponse); - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); - IamPolicyAnalysisOutputConfig outputConfig = IamPolicyAnalysisOutputConfig.newBuilder().build(); - ExportIamPolicyAnalysisRequest request = - ExportIamPolicyAnalysisRequest.newBuilder() - .setAnalysisQuery(analysisQuery) - .setOutputConfig(outputConfig) + AnalyzeIamPolicyRequest request = + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) .build(); - ExportIamPolicyAnalysisResponse actualResponse = - client.exportIamPolicyAnalysisAsync(request).get(); + AnalyzeIamPolicyResponse actualResponse = client.analyzeIamPolicy(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ExportIamPolicyAnalysisRequest actualRequest = - (ExportIamPolicyAnalysisRequest) actualRequests.get(0); + AnalyzeIamPolicyRequest actualRequest = ((AnalyzeIamPolicyRequest) actualRequests.get(0)); - Assert.assertEquals(analysisQuery, actualRequest.getAnalysisQuery()); - Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertEquals(request.getAnalysisQuery(), actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -117,50 +112,54 @@ public void exportIamPolicyAnalysisTest() throws Exception { } @Test - @SuppressWarnings("all") - public void exportIamPolicyAnalysisExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + public void analyzeIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); - IamPolicyAnalysisOutputConfig outputConfig = - IamPolicyAnalysisOutputConfig.newBuilder().build(); - ExportIamPolicyAnalysisRequest request = - ExportIamPolicyAnalysisRequest.newBuilder() - .setAnalysisQuery(analysisQuery) - .setOutputConfig(outputConfig) + AnalyzeIamPolicyRequest request = + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) .build(); - - client.exportIamPolicyAnalysisAsync(request).get(); + client.analyzeIamPolicy(request); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception. } } @Test - @SuppressWarnings("all") - public void analyzeIamPolicyTest() { - boolean fullyExplored = true; - AnalyzeIamPolicyResponse expectedResponse = - AnalyzeIamPolicyResponse.newBuilder().setFullyExplored(fullyExplored).build(); - mockAssetService.addResponse(expectedResponse); + public void exportIamPolicyAnalysisTest() throws Exception { + ExportIamPolicyAnalysisResponse expectedResponse = + ExportIamPolicyAnalysisResponse.newBuilder() + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportIamPolicyAnalysisTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAssetService.addResponse(resultOperation); - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); - AnalyzeIamPolicyRequest request = - AnalyzeIamPolicyRequest.newBuilder().setAnalysisQuery(analysisQuery).build(); + ExportIamPolicyAnalysisRequest request = + ExportIamPolicyAnalysisRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); - AnalyzeIamPolicyResponse actualResponse = client.analyzeIamPolicy(request); + ExportIamPolicyAnalysisResponse actualResponse = + client.exportIamPolicyAnalysisAsync(request).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - AnalyzeIamPolicyRequest actualRequest = (AnalyzeIamPolicyRequest) actualRequests.get(0); + ExportIamPolicyAnalysisRequest actualRequest = + ((ExportIamPolicyAnalysisRequest) actualRequests.get(0)); - Assert.assertEquals(analysisQuery, actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getAnalysisQuery(), actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -168,20 +167,22 @@ public void analyzeIamPolicyTest() { } @Test - @SuppressWarnings("all") - public void analyzeIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + public void exportIamPolicyAnalysisExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - IamPolicyAnalysisQuery analysisQuery = IamPolicyAnalysisQuery.newBuilder().build(); - AnalyzeIamPolicyRequest request = - AnalyzeIamPolicyRequest.newBuilder().setAnalysisQuery(analysisQuery).build(); - - client.analyzeIamPolicy(request); + ExportIamPolicyAnalysisRequest request = + ExportIamPolicyAnalysisRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + client.exportIamPolicyAnalysisAsync(request).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetService.java index ef0547bcb..5a56c78a3 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetService.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetService.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetService implements MockGrpcService { private final MockAssetServiceImpl serviceImpl; diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetServiceImpl.java index dc4ceef49..f62732c97 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetServiceImpl.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetServiceImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p4beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetServiceImpl extends AssetServiceImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void analyzeIamPolicy( Object response = responses.remove(); if (response instanceof AnalyzeIamPolicyResponse) { requests.add(request); - responseObserver.onNext((AnalyzeIamPolicyResponse) response); + responseObserver.onNext(((AnalyzeIamPolicyResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void exportIamPolicyAnalysis( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java index 8519ef138..18b5da8c1 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1; import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; @@ -26,12 +27,14 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -39,31 +42,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AssetServiceClientTest { - private static MockAssetService mockAssetService; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AssetServiceClient client; private LocalChannelProvider channelProvider; + private static MockAssetService mockAssetService; @BeforeClass public static void startStaticServer() { mockAssetService = new MockAssetService(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AssetServiceSettings settings = AssetServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -78,32 +81,41 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listAssetsTest() { - String nextPageToken = ""; - Asset assetsElement = Asset.newBuilder().build(); - List assets = Arrays.asList(assetsElement); + public void listAssetsTest() throws Exception { + Asset responsesElement = Asset.newBuilder().build(); ListAssetsResponse expectedResponse = ListAssetsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllAssets(assets) + .setNextPageToken("") + .addAllAssets(Arrays.asList(responsesElement)) .build(); mockAssetService.addResponse(expectedResponse); - String parent = "parent-995424086"; - ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent).build(); + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent("parent-995424086") + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); ListAssetsPagedResponse pagedListResponse = client.listAssets(request); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getAssetsList().get(0), resources.get(0)); List actualRequests = mockAssetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListAssetsRequest actualRequest = (ListAssetsRequest) actualRequests.get(0); - - Assert.assertEquals(parent, actualRequest.getParent()); + ListAssetsRequest actualRequest = ((ListAssetsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertEquals(request.getAssetTypesList(), actualRequest.getAssetTypesList()); + Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -111,19 +123,23 @@ public void listAssetsTest() { } @Test - @SuppressWarnings("all") public void listAssetsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAssetService.addException(exception); try { - String parent = "parent-995424086"; - ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent).build(); - + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent("parent-995424086") + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); client.listAssets(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java index ff9f7272a..77aba3a12 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetService implements MockGrpcService { private final MockAssetServiceImpl serviceImpl; diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java index 3ab35b893..1372d96c9 100644 --- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.asset.v1p5beta1; import com.google.api.core.BetaApi; @@ -23,9 +24,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAssetServiceImpl extends AssetServiceImplBase { private List requests; private Queue responses; @@ -62,10 +64,10 @@ public void listAssets( Object response = responses.remove(); if (response instanceof ListAssetsResponse) { requests.add(request); - responseObserver.onNext((ListAssetsResponse) response); + responseObserver.onNext(((ListAssetsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java index aef33d8fc..3bf3ebb8d 100644 --- a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java @@ -282,7 +282,7 @@ public boolean getForce() { *
    * [partition_spec] determines whether to export to partitioned table(s) and
    * how to partition the data.
-   * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
    * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
    * non-partitioned table(s). [force] will decide whether to overwrite existing
    * table(s).
@@ -311,7 +311,7 @@ public boolean hasPartitionSpec() {
    * 
    * [partition_spec] determines whether to export to partitioned table(s) and
    * how to partition the data.
-   * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
    * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
    * non-partitioned table(s). [force] will decide whether to overwrite existing
    * table(s).
@@ -342,7 +342,7 @@ public com.google.cloud.asset.v1.PartitionSpec getPartitionSpec() {
    * 
    * [partition_spec] determines whether to export to partitioned table(s) and
    * how to partition the data.
-   * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
    * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
    * non-partitioned table(s). [force] will decide whether to overwrite existing
    * table(s).
@@ -1105,7 +1105,7 @@ public Builder clearForce() {
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1133,7 +1133,7 @@ public boolean hasPartitionSpec() {
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1167,7 +1167,7 @@ public com.google.cloud.asset.v1.PartitionSpec getPartitionSpec() {
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1203,7 +1203,7 @@ public Builder setPartitionSpec(com.google.cloud.asset.v1.PartitionSpec value) {
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1237,7 +1237,7 @@ public Builder setPartitionSpec(
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1277,7 +1277,7 @@ public Builder mergePartitionSpec(com.google.cloud.asset.v1.PartitionSpec value)
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1311,7 +1311,7 @@ public Builder clearPartitionSpec() {
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1339,7 +1339,7 @@ public com.google.cloud.asset.v1.PartitionSpec.Builder getPartitionSpecBuilder()
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
@@ -1371,7 +1371,7 @@ public com.google.cloud.asset.v1.PartitionSpecOrBuilder getPartitionSpecOrBuilde
      * 
      * [partition_spec] determines whether to export to partitioned table(s) and
      * how to partition the data.
-     * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
      * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
      * non-partitioned table(s). [force] will decide whether to overwrite existing
      * table(s).
diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java
index ba83fbc79..c94b5fbaf 100644
--- a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java
+++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java
@@ -105,7 +105,7 @@ public interface BigQueryDestinationOrBuilder
    * 
    * [partition_spec] determines whether to export to partitioned table(s) and
    * how to partition the data.
-   * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
    * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
    * non-partitioned table(s). [force] will decide whether to overwrite existing
    * table(s).
@@ -131,7 +131,7 @@ public interface BigQueryDestinationOrBuilder
    * 
    * [partition_spec] determines whether to export to partitioned table(s) and
    * how to partition the data.
-   * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
    * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
    * non-partitioned table(s). [force] will decide whether to overwrite existing
    * table(s).
@@ -157,7 +157,7 @@ public interface BigQueryDestinationOrBuilder
    * 
    * [partition_spec] determines whether to export to partitioned table(s) and
    * how to partition the data.
-   * If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
    * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
    * non-partitioned table(s). [force] will decide whether to overwrite existing
    * table(s).
diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedName.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedName.java
index 01869a832..b9e600c37 100644
--- a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedName.java
+++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedName.java
@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.apache.org/licenses/LICENSE-2.0
+ *      https://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,
@@ -26,62 +26,71 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import javax.annotation.Generated;
 
-/** AUTO-GENERATED DOCUMENTATION AND CLASS */
-@javax.annotation.Generated("by GAPIC protoc plugin")
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+@Generated("by gapic-generator-java")
 public class FeedName implements ResourceName {
-
-  @Deprecated
-  protected FeedName() {}
-
-  private static final PathTemplate PROJECT_FEED_PATH_TEMPLATE =
+  private static final PathTemplate PROJECT_FEED =
       PathTemplate.createWithoutUrlEncoding("projects/{project}/feeds/{feed}");
-  private static final PathTemplate FOLDER_FEED_PATH_TEMPLATE =
+  private static final PathTemplate FOLDER_FEED =
       PathTemplate.createWithoutUrlEncoding("folders/{folder}/feeds/{feed}");
-  private static final PathTemplate ORGANIZATION_FEED_PATH_TEMPLATE =
+  private static final PathTemplate ORGANIZATION_FEED =
       PathTemplate.createWithoutUrlEncoding("organizations/{organization}/feeds/{feed}");
-
   private volatile Map fieldValuesMap;
   private PathTemplate pathTemplate;
   private String fixedValue;
+  private final String project;
+  private final String feed;
+  private final String folder;
+  private final String organization;
 
-  private String project;
-  private String feed;
-  private String folder;
-  private String organization;
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getFeed() {
-    return feed;
-  }
-
-  public String getFolder() {
-    return folder;
-  }
-
-  public String getOrganization() {
-    return organization;
+  @Deprecated
+  protected FeedName() {
+    project = null;
+    feed = null;
+    folder = null;
+    organization = null;
   }
 
   private FeedName(Builder builder) {
     project = Preconditions.checkNotNull(builder.getProject());
     feed = Preconditions.checkNotNull(builder.getFeed());
-    pathTemplate = PROJECT_FEED_PATH_TEMPLATE;
+    folder = null;
+    organization = null;
+    pathTemplate = PROJECT_FEED;
   }
 
   private FeedName(FolderFeedBuilder builder) {
     folder = Preconditions.checkNotNull(builder.getFolder());
     feed = Preconditions.checkNotNull(builder.getFeed());
-    pathTemplate = FOLDER_FEED_PATH_TEMPLATE;
+    project = null;
+    organization = null;
+    pathTemplate = FOLDER_FEED;
   }
 
   private FeedName(OrganizationFeedBuilder builder) {
     organization = Preconditions.checkNotNull(builder.getOrganization());
     feed = Preconditions.checkNotNull(builder.getFeed());
-    pathTemplate = ORGANIZATION_FEED_PATH_TEMPLATE;
+    project = null;
+    folder = null;
+    pathTemplate = ORGANIZATION_FEED;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getFeed() {
+    return feed;
+  }
+
+  public String getFolder() {
+    return folder;
+  }
+
+  public String getOrganization() {
+    return organization;
   }
 
   public static Builder newBuilder() {
@@ -108,12 +117,12 @@ public Builder toBuilder() {
   }
 
   public static FeedName of(String project, String feed) {
-    return newProjectFeedBuilder().setProject(project).setFeed(feed).build();
+    return newBuilder().setProject(project).setFeed(feed).build();
   }
 
   @BetaApi("The static create methods are not stable yet and may be changed in the future.")
   public static FeedName ofProjectFeedName(String project, String feed) {
-    return newProjectFeedBuilder().setProject(project).setFeed(feed).build();
+    return newBuilder().setProject(project).setFeed(feed).build();
   }
 
   @BetaApi("The static create methods are not stable yet and may be changed in the future.")
@@ -153,17 +162,17 @@ public static FeedName parse(String formattedString) {
     if (formattedString.isEmpty()) {
       return null;
     }
-    if (PROJECT_FEED_PATH_TEMPLATE.matches(formattedString)) {
-      Map matchMap = PROJECT_FEED_PATH_TEMPLATE.match(formattedString);
+    if (PROJECT_FEED.matches(formattedString)) {
+      Map matchMap = PROJECT_FEED.match(formattedString);
       return ofProjectFeedName(matchMap.get("project"), matchMap.get("feed"));
-    } else if (FOLDER_FEED_PATH_TEMPLATE.matches(formattedString)) {
-      Map matchMap = FOLDER_FEED_PATH_TEMPLATE.match(formattedString);
+    } else if (FOLDER_FEED.matches(formattedString)) {
+      Map matchMap = FOLDER_FEED.match(formattedString);
       return ofFolderFeedName(matchMap.get("folder"), matchMap.get("feed"));
-    } else if (ORGANIZATION_FEED_PATH_TEMPLATE.matches(formattedString)) {
-      Map matchMap = ORGANIZATION_FEED_PATH_TEMPLATE.match(formattedString);
+    } else if (ORGANIZATION_FEED.matches(formattedString)) {
+      Map matchMap = ORGANIZATION_FEED.match(formattedString);
       return ofOrganizationFeedName(matchMap.get("organization"), matchMap.get("feed"));
     }
-    throw new ValidationException("JobName.parse: formattedString not in valid format");
+    throw new ValidationException("FeedName.parse: formattedString not in valid format");
   }
 
   public static List parseList(List formattedStrings) {
@@ -187,9 +196,9 @@ public static List toStringList(List values) {
   }
 
   public static boolean isParsableFrom(String formattedString) {
-    return PROJECT_FEED_PATH_TEMPLATE.matches(formattedString)
-        || FOLDER_FEED_PATH_TEMPLATE.matches(formattedString)
-        || ORGANIZATION_FEED_PATH_TEMPLATE.matches(formattedString);
+    return PROJECT_FEED.matches(formattedString)
+        || FOLDER_FEED.matches(formattedString)
+        || ORGANIZATION_FEED.matches(formattedString);
   }
 
   @Override
@@ -226,9 +235,39 @@ public String toString() {
     return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap());
   }
 
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o != null || getClass() == o.getClass()) {
+      FeedName that = ((FeedName) o);
+      return Objects.equals(this.project, that.project)
+          && Objects.equals(this.feed, that.feed)
+          && Objects.equals(this.folder, that.folder)
+          && Objects.equals(this.organization, that.organization);
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    int h = 1;
+    h *= 1000003;
+    h ^= Objects.hashCode(fixedValue);
+    h *= 1000003;
+    h ^= Objects.hashCode(project);
+    h *= 1000003;
+    h ^= Objects.hashCode(feed);
+    h *= 1000003;
+    h ^= Objects.hashCode(folder);
+    h *= 1000003;
+    h ^= Objects.hashCode(organization);
+    return h;
+  }
+
   /** Builder for projects/{project}/feeds/{feed}. */
   public static class Builder {
-
     private String project;
     private String feed;
 
@@ -254,9 +293,8 @@ public Builder setFeed(String feed) {
 
     private Builder(FeedName feedName) {
       Preconditions.checkArgument(
-          feedName.pathTemplate == PROJECT_FEED_PATH_TEMPLATE,
-          "toBuilder is only supported when FeedName has the pattern of "
-              + "projects/{project}/feeds/{feed}.");
+          Objects.equals(feedName.pathTemplate, PROJECT_FEED),
+          "toBuilder is only supported when FeedName has the pattern of projects/{project}/feeds/{feed}");
       project = feedName.project;
       feed = feedName.feed;
     }
@@ -269,11 +307,10 @@ public FeedName build() {
   /** Builder for folders/{folder}/feeds/{feed}. */
   @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
   public static class FolderFeedBuilder {
-
     private String folder;
     private String feed;
 
-    private FolderFeedBuilder() {}
+    protected FolderFeedBuilder() {}
 
     public String getFolder() {
       return folder;
@@ -301,11 +338,10 @@ public FeedName build() {
   /** Builder for organizations/{organization}/feeds/{feed}. */
   @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
   public static class OrganizationFeedBuilder {
-
     private String organization;
     private String feed;
 
-    private OrganizationFeedBuilder() {}
+    protected OrganizationFeedBuilder() {}
 
     public String getOrganization() {
       return organization;
@@ -329,35 +365,4 @@ public FeedName build() {
       return new FeedName(this);
     }
   }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o != null || getClass() == o.getClass()) {
-      FeedName that = (FeedName) o;
-      return (Objects.equals(this.project, that.project))
-          && (Objects.equals(this.feed, that.feed))
-          && (Objects.equals(this.folder, that.folder))
-          && (Objects.equals(this.organization, that.organization));
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    int h = 1;
-    h *= 1000003;
-    h ^= Objects.hashCode(fixedValue);
-    h *= 1000003;
-    h ^= Objects.hashCode(project);
-    h *= 1000003;
-    h ^= Objects.hashCode(feed);
-    h *= 1000003;
-    h ^= Objects.hashCode(folder);
-    h *= 1000003;
-    h ^= Objects.hashCode(organization);
-    return h;
-  }
 }
diff --git a/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto b/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto
index ee8c4129d..d7d22fee9 100644
--- a/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto
+++ b/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto
@@ -425,7 +425,7 @@ message BigQueryDestination {
   // [partition_spec] determines whether to export to partitioned table(s) and
   // how to partition the data.
   //
-  // If [partition_spec] is unset or [partition_spec.partion_key] is unset or
+  // If [partition_spec] is unset or [partition_spec.partition_key] is unset or
   // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
   // non-partitioned table(s). [force] will decide whether to overwrite existing
   // table(s).
diff --git a/proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedName.java b/proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedName.java
index bfd40a599..6feaaabfb 100644
--- a/proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedName.java
+++ b/proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedName.java
@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.apache.org/licenses/LICENSE-2.0
+ *      https://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,
@@ -26,62 +26,71 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import javax.annotation.Generated;
 
-/** AUTO-GENERATED DOCUMENTATION AND CLASS */
-@javax.annotation.Generated("by GAPIC protoc plugin")
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+@Generated("by gapic-generator-java")
 public class FeedName implements ResourceName {
-
-  @Deprecated
-  protected FeedName() {}
-
-  private static final PathTemplate PROJECT_FEED_PATH_TEMPLATE =
+  private static final PathTemplate PROJECT_FEED =
       PathTemplate.createWithoutUrlEncoding("projects/{project}/feeds/{feed}");
-  private static final PathTemplate FOLDER_FEED_PATH_TEMPLATE =
+  private static final PathTemplate FOLDER_FEED =
       PathTemplate.createWithoutUrlEncoding("folders/{folder}/feeds/{feed}");
-  private static final PathTemplate ORGANIZATION_FEED_PATH_TEMPLATE =
+  private static final PathTemplate ORGANIZATION_FEED =
       PathTemplate.createWithoutUrlEncoding("organizations/{organization}/feeds/{feed}");
-
   private volatile Map fieldValuesMap;
   private PathTemplate pathTemplate;
   private String fixedValue;
+  private final String project;
+  private final String feed;
+  private final String folder;
+  private final String organization;
 
-  private String project;
-  private String feed;
-  private String folder;
-  private String organization;
-
-  public String getProject() {
-    return project;
-  }
-
-  public String getFeed() {
-    return feed;
-  }
-
-  public String getFolder() {
-    return folder;
-  }
-
-  public String getOrganization() {
-    return organization;
+  @Deprecated
+  protected FeedName() {
+    project = null;
+    feed = null;
+    folder = null;
+    organization = null;
   }
 
   private FeedName(Builder builder) {
     project = Preconditions.checkNotNull(builder.getProject());
     feed = Preconditions.checkNotNull(builder.getFeed());
-    pathTemplate = PROJECT_FEED_PATH_TEMPLATE;
+    folder = null;
+    organization = null;
+    pathTemplate = PROJECT_FEED;
   }
 
   private FeedName(FolderFeedBuilder builder) {
     folder = Preconditions.checkNotNull(builder.getFolder());
     feed = Preconditions.checkNotNull(builder.getFeed());
-    pathTemplate = FOLDER_FEED_PATH_TEMPLATE;
+    project = null;
+    organization = null;
+    pathTemplate = FOLDER_FEED;
   }
 
   private FeedName(OrganizationFeedBuilder builder) {
     organization = Preconditions.checkNotNull(builder.getOrganization());
     feed = Preconditions.checkNotNull(builder.getFeed());
-    pathTemplate = ORGANIZATION_FEED_PATH_TEMPLATE;
+    project = null;
+    folder = null;
+    pathTemplate = ORGANIZATION_FEED;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getFeed() {
+    return feed;
+  }
+
+  public String getFolder() {
+    return folder;
+  }
+
+  public String getOrganization() {
+    return organization;
   }
 
   public static Builder newBuilder() {
@@ -108,12 +117,12 @@ public Builder toBuilder() {
   }
 
   public static FeedName of(String project, String feed) {
-    return newProjectFeedBuilder().setProject(project).setFeed(feed).build();
+    return newBuilder().setProject(project).setFeed(feed).build();
   }
 
   @BetaApi("The static create methods are not stable yet and may be changed in the future.")
   public static FeedName ofProjectFeedName(String project, String feed) {
-    return newProjectFeedBuilder().setProject(project).setFeed(feed).build();
+    return newBuilder().setProject(project).setFeed(feed).build();
   }
 
   @BetaApi("The static create methods are not stable yet and may be changed in the future.")
@@ -153,17 +162,17 @@ public static FeedName parse(String formattedString) {
     if (formattedString.isEmpty()) {
       return null;
     }
-    if (PROJECT_FEED_PATH_TEMPLATE.matches(formattedString)) {
-      Map matchMap = PROJECT_FEED_PATH_TEMPLATE.match(formattedString);
+    if (PROJECT_FEED.matches(formattedString)) {
+      Map matchMap = PROJECT_FEED.match(formattedString);
       return ofProjectFeedName(matchMap.get("project"), matchMap.get("feed"));
-    } else if (FOLDER_FEED_PATH_TEMPLATE.matches(formattedString)) {
-      Map matchMap = FOLDER_FEED_PATH_TEMPLATE.match(formattedString);
+    } else if (FOLDER_FEED.matches(formattedString)) {
+      Map matchMap = FOLDER_FEED.match(formattedString);
       return ofFolderFeedName(matchMap.get("folder"), matchMap.get("feed"));
-    } else if (ORGANIZATION_FEED_PATH_TEMPLATE.matches(formattedString)) {
-      Map matchMap = ORGANIZATION_FEED_PATH_TEMPLATE.match(formattedString);
+    } else if (ORGANIZATION_FEED.matches(formattedString)) {
+      Map matchMap = ORGANIZATION_FEED.match(formattedString);
       return ofOrganizationFeedName(matchMap.get("organization"), matchMap.get("feed"));
     }
-    throw new ValidationException("JobName.parse: formattedString not in valid format");
+    throw new ValidationException("FeedName.parse: formattedString not in valid format");
   }
 
   public static List parseList(List formattedStrings) {
@@ -187,9 +196,9 @@ public static List toStringList(List values) {
   }
 
   public static boolean isParsableFrom(String formattedString) {
-    return PROJECT_FEED_PATH_TEMPLATE.matches(formattedString)
-        || FOLDER_FEED_PATH_TEMPLATE.matches(formattedString)
-        || ORGANIZATION_FEED_PATH_TEMPLATE.matches(formattedString);
+    return PROJECT_FEED.matches(formattedString)
+        || FOLDER_FEED.matches(formattedString)
+        || ORGANIZATION_FEED.matches(formattedString);
   }
 
   @Override
@@ -226,9 +235,39 @@ public String toString() {
     return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap());
   }
 
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o != null || getClass() == o.getClass()) {
+      FeedName that = ((FeedName) o);
+      return Objects.equals(this.project, that.project)
+          && Objects.equals(this.feed, that.feed)
+          && Objects.equals(this.folder, that.folder)
+          && Objects.equals(this.organization, that.organization);
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    int h = 1;
+    h *= 1000003;
+    h ^= Objects.hashCode(fixedValue);
+    h *= 1000003;
+    h ^= Objects.hashCode(project);
+    h *= 1000003;
+    h ^= Objects.hashCode(feed);
+    h *= 1000003;
+    h ^= Objects.hashCode(folder);
+    h *= 1000003;
+    h ^= Objects.hashCode(organization);
+    return h;
+  }
+
   /** Builder for projects/{project}/feeds/{feed}. */
   public static class Builder {
-
     private String project;
     private String feed;
 
@@ -254,9 +293,8 @@ public Builder setFeed(String feed) {
 
     private Builder(FeedName feedName) {
       Preconditions.checkArgument(
-          feedName.pathTemplate == PROJECT_FEED_PATH_TEMPLATE,
-          "toBuilder is only supported when FeedName has the pattern of "
-              + "projects/{project}/feeds/{feed}.");
+          Objects.equals(feedName.pathTemplate, PROJECT_FEED),
+          "toBuilder is only supported when FeedName has the pattern of projects/{project}/feeds/{feed}");
       project = feedName.project;
       feed = feedName.feed;
     }
@@ -269,11 +307,10 @@ public FeedName build() {
   /** Builder for folders/{folder}/feeds/{feed}. */
   @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
   public static class FolderFeedBuilder {
-
     private String folder;
     private String feed;
 
-    private FolderFeedBuilder() {}
+    protected FolderFeedBuilder() {}
 
     public String getFolder() {
       return folder;
@@ -301,11 +338,10 @@ public FeedName build() {
   /** Builder for organizations/{organization}/feeds/{feed}. */
   @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.")
   public static class OrganizationFeedBuilder {
-
     private String organization;
     private String feed;
 
-    private OrganizationFeedBuilder() {}
+    protected OrganizationFeedBuilder() {}
 
     public String getOrganization() {
       return organization;
@@ -329,35 +365,4 @@ public FeedName build() {
       return new FeedName(this);
     }
   }
-
-  @Override
-  public boolean equals(Object o) {
-    if (o == this) {
-      return true;
-    }
-    if (o != null || getClass() == o.getClass()) {
-      FeedName that = (FeedName) o;
-      return (Objects.equals(this.project, that.project))
-          && (Objects.equals(this.feed, that.feed))
-          && (Objects.equals(this.folder, that.folder))
-          && (Objects.equals(this.organization, that.organization));
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    int h = 1;
-    h *= 1000003;
-    h ^= Objects.hashCode(fixedValue);
-    h *= 1000003;
-    h ^= Objects.hashCode(project);
-    h *= 1000003;
-    h ^= Objects.hashCode(feed);
-    h *= 1000003;
-    h ^= Objects.hashCode(folder);
-    h *= 1000003;
-    h ^= Objects.hashCode(organization);
-    return h;
-  }
 }
diff --git a/synth.metadata b/synth.metadata
index cc124517f..4d8f967bf 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,55 +4,47 @@
       "git": {
         "name": ".",
         "remote": "https://github.com/googleapis/java-asset.git",
-        "sha": "0cdd449bbd5ca3241f4a9ef795550171d042b02b"
+        "sha": "aeb8c5ae66c605b3de855b9fe823664b53f51c6f"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb",
-        "internalRef": "342689216"
+        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
+        "internalRef": "346372957"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb",
-        "internalRef": "342689216"
+        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
+        "internalRef": "346372957"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb",
-        "internalRef": "342689216"
+        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
+        "internalRef": "346372957"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb",
-        "internalRef": "342689216"
+        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
+        "internalRef": "346372957"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb",
-        "internalRef": "342689216"
-      }
-    },
-    {
-      "git": {
-        "name": "googleapis",
-        "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "1f8a5144b52f7677dc43c55b21ccaf9e1b425ceb",
-        "internalRef": "342689216"
+        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
+        "internalRef": "346372957"
       }
     },
     {

From 89ac9a08878fcd3ebaa52cf678b2a01ec095aff1 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot 
Date: Wed, 30 Dec 2020 10:32:40 -0800
Subject: [PATCH 12/22] ci(java): ignore bot users for generate-files-bot
 (#495)

Depends on https://github.com/googleapis/repo-automation-bots/pull/1254

Fixes https://github.com/googleapis/repo-automation-bots/issues/1096

Source-Author: Jeff Ching 
Source-Date: Tue Dec 15 16:16:07 2020 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 3f67ceece7e797a5736a25488aae35405649b90b
Source-Link: https://github.com/googleapis/synthtool/commit/3f67ceece7e797a5736a25488aae35405649b90b

Co-authored-by: Jeff Ching 
---
 .github/generated-files-bot.yml |  4 ++++
 synth.metadata                  | 10 +---------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml
index 20f3acc28..47c2ba132 100644
--- a/.github/generated-files-bot.yml
+++ b/.github/generated-files-bot.yml
@@ -5,3 +5,7 @@ externalManifests:
 - type: json
   file: '.github/readme/synth.metadata/synth.metadata'
   jsonpath: '$.generatedFiles[*]'
+ignoreAuthors:
+- 'renovate-bot'
+- 'yoshi-automation'
+- 'release-please[bot]'
diff --git a/synth.metadata b/synth.metadata
index 4d8f967bf..1260f32dd 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -39,19 +39,11 @@
         "internalRef": "346372957"
       }
     },
-    {
-      "git": {
-        "name": "googleapis",
-        "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
-        "internalRef": "346372957"
-      }
-    },
     {
       "git": {
         "name": "synthtool",
         "remote": "https://github.com/googleapis/synthtool.git",
-        "sha": "5d11bd2888c38ce1fb6fa6bf25494a4219a73928"
+        "sha": "3f67ceece7e797a5736a25488aae35405649b90b"
       }
     }
   ],

From 9f36ac24942e2d2ca2581bb03613d5c44178447a Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot 
Date: Wed, 30 Dec 2020 11:09:57 -0800
Subject: [PATCH 13/22] chore(java): remove formatter action (#498)

Source-Author: Jeff Ching 
Source-Date: Tue Dec 29 10:50:17 2020 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 6133907dbb3ddab204a17a15d5c53ec0aae9b033
Source-Link: https://github.com/googleapis/synthtool/commit/6133907dbb3ddab204a17a15d5c53ec0aae9b033
---
 .github/workflows/formatting.yaml | 25 -------------------------
 synth.metadata                    | 13 ++++++++++---
 2 files changed, 10 insertions(+), 28 deletions(-)
 delete mode 100644 .github/workflows/formatting.yaml

diff --git a/.github/workflows/formatting.yaml b/.github/workflows/formatting.yaml
deleted file mode 100644
index 6844407b4..000000000
--- a/.github/workflows/formatting.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-on:
-  pull_request_target:
-    types: [opened, synchronize]
-    branches:
-      - master
-name: format
-jobs:
-  format-code:
-    runs-on: ubuntu-latest
-    env:
-      ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          ref: ${{github.event.pull_request.head.ref}}
-          repository: ${{github.event.pull_request.head.repo.full_name}}
-      - uses: actions/setup-java@v1
-        with:
-          java-version: 11
-      - run: "mvn com.coveo:fmt-maven-plugin:format"
-      - uses: googleapis/code-suggester@v1
-        with:
-          command: review
-          pull_number: ${{ github.event.pull_request.number }}
-          git_dir: '.'
diff --git a/synth.metadata b/synth.metadata
index 1260f32dd..2bb03221b 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,15 @@
       "git": {
         "name": ".",
         "remote": "https://github.com/googleapis/java-asset.git",
-        "sha": "aeb8c5ae66c605b3de855b9fe823664b53f51c6f"
+        "sha": "89ac9a08878fcd3ebaa52cf678b2a01ec095aff1"
+      }
+    },
+    {
+      "git": {
+        "name": "googleapis",
+        "remote": "https://github.com/googleapis/googleapis.git",
+        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
+        "internalRef": "346372957"
       }
     },
     {
@@ -43,7 +51,7 @@
       "git": {
         "name": "synthtool",
         "remote": "https://github.com/googleapis/synthtool.git",
-        "sha": "3f67ceece7e797a5736a25488aae35405649b90b"
+        "sha": "6133907dbb3ddab204a17a15d5c53ec0aae9b033"
       }
     }
   ],
@@ -109,7 +117,6 @@
     ".github/workflows/approve-readme.yaml",
     ".github/workflows/auto-release.yaml",
     ".github/workflows/ci.yaml",
-    ".github/workflows/formatting.yaml",
     ".github/workflows/samples.yaml",
     ".kokoro/build.bat",
     ".kokoro/build.sh",

From 450c05a69a4504b162a6fecd27ad9cc212efcae6 Mon Sep 17 00:00:00 2001
From: Suraj Dhamecha <48670070+suraj-qlogic@users.noreply.github.com>
Date: Tue, 5 Jan 2021 20:59:04 +0530
Subject: [PATCH 14/22] chore(samples): remove unused import from sample (#499)

---
 .../src/main/java/com/example/asset/DeleteFeedExample.java      | 2 --
 .../src/main/java/com/example/asset/GetFeedExample.java         | 1 -
 .../src/main/java/com/example/asset/ListAssetsExample.java      | 1 -
 .../src/main/java/com/example/asset/ListFeedsExample.java       | 1 -
 .../src/main/java/com/example/asset/UpdateFeedExample.java      | 1 -
 .../snippets/src/test/java/com/example/asset/ListAssets.java    | 1 -
 .../snippets/src/test/java/com/example/asset/RealTimeFeed.java  | 1 -
 7 files changed, 8 deletions(-)

diff --git a/samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java b/samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java
index 2f9ae34d0..162b4e2ab 100644
--- a/samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java
+++ b/samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java
@@ -18,8 +18,6 @@
 
 // [START asset_quickstart_delete_feed]
 import com.google.cloud.asset.v1.AssetServiceClient;
-import com.google.cloud.asset.v1.Feed;
-import java.util.Arrays;
 
 public class DeleteFeedExample {
 
diff --git a/samples/snippets/src/main/java/com/example/asset/GetFeedExample.java b/samples/snippets/src/main/java/com/example/asset/GetFeedExample.java
index 5544538ca..cc0b5a5f5 100644
--- a/samples/snippets/src/main/java/com/example/asset/GetFeedExample.java
+++ b/samples/snippets/src/main/java/com/example/asset/GetFeedExample.java
@@ -19,7 +19,6 @@
 // [START asset_quickstart_get_feed]
 import com.google.cloud.asset.v1.AssetServiceClient;
 import com.google.cloud.asset.v1.Feed;
-import java.util.Arrays;
 
 public class GetFeedExample {
 
diff --git a/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java b/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java
index 96e3d994a..b315aef72 100644
--- a/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java
+++ b/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java
@@ -19,7 +19,6 @@
 // [START asset_quickstart_list_assets]
 // Imports the Google Cloud client library
 
-import com.google.cloud.ServiceOptions;
 import com.google.cloud.asset.v1.ProjectName;
 import com.google.cloud.asset.v1p5beta1.AssetServiceClient;
 import com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse;
diff --git a/samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java b/samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java
index 8b5974604..1a23535ca 100644
--- a/samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java
+++ b/samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java
@@ -20,7 +20,6 @@
 import com.google.cloud.asset.v1.AssetServiceClient;
 import com.google.cloud.asset.v1.ListFeedsResponse;
 import com.google.cloud.asset.v1.ProjectName;
-import java.util.Arrays;
 
 public class ListFeedsExample {
   // List feeds in a project.
diff --git a/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java b/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java
index cd5951ffa..d3e651723 100644
--- a/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java
+++ b/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java
@@ -23,7 +23,6 @@
 import com.google.cloud.asset.v1.PubsubDestination;
 import com.google.cloud.asset.v1.UpdateFeedRequest;
 import com.google.protobuf.FieldMask;
-import java.util.Arrays;
 
 public class UpdateFeedExample {
 
diff --git a/samples/snippets/src/test/java/com/example/asset/ListAssets.java b/samples/snippets/src/test/java/com/example/asset/ListAssets.java
index 5a2d2d313..3e8f01c71 100644
--- a/samples/snippets/src/test/java/com/example/asset/ListAssets.java
+++ b/samples/snippets/src/test/java/com/example/asset/ListAssets.java
@@ -22,7 +22,6 @@
 import com.google.cloud.asset.v1p5beta1.ContentType;
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
-import java.util.UUID;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
diff --git a/samples/snippets/src/test/java/com/example/asset/RealTimeFeed.java b/samples/snippets/src/test/java/com/example/asset/RealTimeFeed.java
index acf1fd358..53f30c226 100644
--- a/samples/snippets/src/test/java/com/example/asset/RealTimeFeed.java
+++ b/samples/snippets/src/test/java/com/example/asset/RealTimeFeed.java
@@ -18,7 +18,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import com.google.cloud.ServiceOptions;
 import com.google.cloud.pubsub.v1.TopicAdminClient;
 import com.google.cloud.resourcemanager.ProjectInfo;
 import com.google.cloud.resourcemanager.ResourceManager;

From 88637b57f3daedfc85b8e394a10a1f4e1e8461ca Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot 
Date: Wed, 6 Jan 2021 14:34:17 -0800
Subject: [PATCH 15/22] chore: update gapic-generator-java to 0.0.16 (#501)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/02f3f7d0-08fc-4839-a558-c7336aba8595/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 350067652
Source-Link: https://github.com/googleapis/googleapis/commit/ad3bb00ed7750cd0625b3a36e0e2eff29f778e4a
---
 .../asset/v1/AssetServiceClientTest.java      |  1 +
 .../v1p4beta1/AssetServiceClientTest.java     |  5 +++++
 synth.metadata                                | 22 +++++++++----------
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java
index a85f37158..328d07196 100644
--- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java
+++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java
@@ -579,6 +579,7 @@ public void searchAllIamPoliciesExceptionTest() throws Exception {
   public void analyzeIamPolicyTest() throws Exception {
     AnalyzeIamPolicyResponse expectedResponse =
         AnalyzeIamPolicyResponse.newBuilder()
+            .setMainAnalysis(AnalyzeIamPolicyResponse.IamPolicyAnalysis.newBuilder().build())
             .addAllServiceAccountImpersonationAnalysis(
                 new ArrayList())
             .setFullyExplored(true)
diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java
index b1bc59ee0..0aa8d9128 100644
--- a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java
+++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java
@@ -84,6 +84,7 @@ public void tearDown() throws Exception {
   public void analyzeIamPolicyTest() throws Exception {
     AnalyzeIamPolicyResponse expectedResponse =
         AnalyzeIamPolicyResponse.newBuilder()
+            .setMainAnalysis(AnalyzeIamPolicyResponse.IamPolicyAnalysis.newBuilder().build())
             .addAllServiceAccountImpersonationAnalysis(
                 new ArrayList())
             .setFullyExplored(true)
@@ -94,6 +95,7 @@ public void analyzeIamPolicyTest() throws Exception {
     AnalyzeIamPolicyRequest request =
         AnalyzeIamPolicyRequest.newBuilder()
             .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
+            .setOptions(AnalyzeIamPolicyRequest.Options.newBuilder().build())
             .build();
 
     AnalyzeIamPolicyResponse actualResponse = client.analyzeIamPolicy(request);
@@ -120,6 +122,7 @@ public void analyzeIamPolicyExceptionTest() throws Exception {
       AnalyzeIamPolicyRequest request =
           AnalyzeIamPolicyRequest.newBuilder()
               .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
+              .setOptions(AnalyzeIamPolicyRequest.Options.newBuilder().build())
               .build();
       client.analyzeIamPolicy(request);
       Assert.fail("No exception raised");
@@ -145,6 +148,7 @@ public void exportIamPolicyAnalysisTest() throws Exception {
     ExportIamPolicyAnalysisRequest request =
         ExportIamPolicyAnalysisRequest.newBuilder()
             .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
+            .setOptions(ExportIamPolicyAnalysisRequest.Options.newBuilder().build())
             .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build())
             .build();
 
@@ -175,6 +179,7 @@ public void exportIamPolicyAnalysisExceptionTest() throws Exception {
       ExportIamPolicyAnalysisRequest request =
           ExportIamPolicyAnalysisRequest.newBuilder()
               .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build())
+              .setOptions(ExportIamPolicyAnalysisRequest.Options.newBuilder().build())
               .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build())
               .build();
       client.exportIamPolicyAnalysisAsync(request).get();
diff --git a/synth.metadata b/synth.metadata
index 2bb03221b..fa72f72f1 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,47 +4,47 @@
       "git": {
         "name": ".",
         "remote": "https://github.com/googleapis/java-asset.git",
-        "sha": "89ac9a08878fcd3ebaa52cf678b2a01ec095aff1"
+        "sha": "9f36ac24942e2d2ca2581bb03613d5c44178447a"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
-        "internalRef": "346372957"
+        "sha": "ad3bb00ed7750cd0625b3a36e0e2eff29f778e4a",
+        "internalRef": "350067652"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
-        "internalRef": "346372957"
+        "sha": "ad3bb00ed7750cd0625b3a36e0e2eff29f778e4a",
+        "internalRef": "350067652"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
-        "internalRef": "346372957"
+        "sha": "ad3bb00ed7750cd0625b3a36e0e2eff29f778e4a",
+        "internalRef": "350067652"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
-        "internalRef": "346372957"
+        "sha": "ad3bb00ed7750cd0625b3a36e0e2eff29f778e4a",
+        "internalRef": "350067652"
       }
     },
     {
       "git": {
         "name": "googleapis",
         "remote": "https://github.com/googleapis/googleapis.git",
-        "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19",
-        "internalRef": "346372957"
+        "sha": "ad3bb00ed7750cd0625b3a36e0e2eff29f778e4a",
+        "internalRef": "350067652"
       }
     },
     {

From f73e4d0672849e9fd91c201ed6032e935b920aad Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot 
Date: Wed, 6 Jan 2021 15:22:15 -0800
Subject: [PATCH 16/22] chore: regenerate README (#507)

This PR was generated using Autosynth. :rainbow:


Log from Synthtool ``` 2021-01-06 22:36:38,441 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-asset/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-01-06 22:36:39,297 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/46ce6b37-df27-4061-a8ab-1e425ff92f9c/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index d2d00638f..a406fe890 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-asset.git", - "sha": "180a4ab37307a4e10487b9468e360faf3961d468" + "sha": "88637b57f3daedfc85b8e394a10a1f4e1e8461ca" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "996775eca5fd934edac3c2ae34b80ff0395b1717" + "sha": "a3e990f3545dc8ccd384a75d20ce9cb185ca6a28" } } ] diff --git a/README.md b/README.md index e17efbfe3..dc7d669b8 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,20 @@ If you are using Maven without BOM, add this to your dependencies: ``` -If you are using Gradle, add this to your dependencies +If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-asset:2.2.0' +implementation platform('com.google.cloud:libraries-bom:16.2.0') + +compile 'com.google.cloud:google-cloud-asset' +``` +If you are using Gradle without BOM, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-asset:2.2.1' ``` + If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "2.2.0" +libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "2.2.1" ``` ## Authentication From 97b51ad3eede73ddb8b5604ede2870c9f7159629 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Jan 2021 17:24:31 +0100 Subject: [PATCH 17/22] deps: update dependency com.google.cloud:google-cloud-storage to v1.113.8 (#502) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7abf8e58d..ca2592d6b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -41,7 +41,7 @@ com.google.cloud google-cloud-storage - 1.113.6 + 1.113.8 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9c41f919e..c08e752d3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -40,7 +40,7 @@ com.google.cloud google-cloud-storage - 1.113.6 + 1.113.8 test From b5c6bc845fd9dc25a22fe8ce30f01a111d33b51f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Jan 2021 17:25:00 +0100 Subject: [PATCH 18/22] deps: update dependency com.google.cloud:google-cloud-resourcemanager to v0.118.7-alpha (#506) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e322dc9a0..3b4bd271e 100644 --- a/pom.xml +++ b/pom.xml @@ -177,7 +177,7 @@ com.google.cloud google-cloud-resourcemanager - 0.118.6-alpha + 0.118.7-alpha test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ca2592d6b..3f4b6ece7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -59,7 +59,7 @@ com.google.cloud google-cloud-resourcemanager - 0.118.6-alpha + 0.118.7-alpha test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c08e752d3..4a24fb555 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -58,7 +58,7 @@ com.google.cloud google-cloud-resourcemanager - 0.118.6-alpha + 0.118.7-alpha test From d10939d0e44ff5dddc74b5994b719b2e15094af8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Jan 2021 17:25:20 +0100 Subject: [PATCH 19/22] chore(deps): update dependency com.google.cloud:google-cloud-asset to v2.2.1 (#503) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3f4b6ece7..c7f18e3fe 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-asset - 2.2.0 + 2.2.1 From 257152096e3c607f8324036db9d2d784ddbc7c5f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Jan 2021 17:25:43 +0100 Subject: [PATCH 20/22] deps: update dependency com.google.api.grpc:proto-google-cloud-os-config-v1 to v1.1.3 (#504) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3b4bd271e..a8138db28 100644 --- a/pom.xml +++ b/pom.xml @@ -153,7 +153,7 @@ com.google.api.grpc proto-google-cloud-os-config-v1 - 1.1.1 + 1.1.3 From 78f2e42f4a30592d2bc7ea43ae2b3bd2129fef1f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Jan 2021 17:25:56 +0100 Subject: [PATCH 21/22] chore(deps): update dependency com.google.cloud:libraries-bom to v16.2.1 (#508) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b5634b41f..44ef2ef0f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -29,7 +29,7 @@ com.google.cloud libraries-bom - 16.2.0 + 16.2.1 pom import From 4711b23fbe167a7642e4598b74feb43173ac43ce Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Jan 2021 11:53:07 -0500 Subject: [PATCH 22/22] chore: release 2.3.0 (#496) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 15 ++++++++++++ google-cloud-asset-bom/pom.xml | 28 +++++++++++----------- google-cloud-asset/pom.xml | 4 ++-- grpc-google-cloud-asset-v1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p1beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p2beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p4beta1/pom.xml | 4 ++-- grpc-google-cloud-asset-v1p5beta1/pom.xml | 4 ++-- pom.xml | 28 +++++++++++----------- proto-google-cloud-asset-v1/pom.xml | 4 ++-- proto-google-cloud-asset-v1beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p1beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p2beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p4beta1/pom.xml | 4 ++-- proto-google-cloud-asset-v1p5beta1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 26 ++++++++++---------- 18 files changed, 83 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90644e7e0..ae774f090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.3.0](https://www.github.com/googleapis/java-asset/compare/v2.2.1...v2.3.0) (2021-01-07) + + +### Features + +* deprecate v1beta1 client endpoint is turned down ([#493](https://www.github.com/googleapis/java-asset/issues/493)) ([0d52720](https://www.github.com/googleapis/java-asset/commit/0d52720188fd521efc94492ccb89794826070b69)), closes [#481](https://www.github.com/googleapis/java-asset/issues/481) + + +### Dependencies + +* update dependency com.google.api.grpc:proto-google-cloud-os-config-v1 to v1.1.3 ([#504](https://www.github.com/googleapis/java-asset/issues/504)) ([2571520](https://www.github.com/googleapis/java-asset/commit/257152096e3c607f8324036db9d2d784ddbc7c5f)) +* update dependency com.google.cloud:google-cloud-resourcemanager to v0.118.7-alpha ([#506](https://www.github.com/googleapis/java-asset/issues/506)) ([b5c6bc8](https://www.github.com/googleapis/java-asset/commit/b5c6bc845fd9dc25a22fe8ce30f01a111d33b51f)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#487](https://www.github.com/googleapis/java-asset/issues/487)) ([439daca](https://www.github.com/googleapis/java-asset/commit/439daca0bc021215809d7a3a27611046c37c6e6f)) +* update dependency com.google.cloud:google-cloud-storage to v1.113.8 ([#502](https://www.github.com/googleapis/java-asset/issues/502)) ([97b51ad](https://www.github.com/googleapis/java-asset/commit/97b51ad3eede73ddb8b5604ede2870c9f7159629)) + ### [2.2.1](https://www.github.com/googleapis/java-asset/compare/v2.2.0...v2.2.1) (2020-12-14) diff --git a/google-cloud-asset-bom/pom.xml b/google-cloud-asset-bom/pom.xml index e2e0356f8..16adf80a3 100644 --- a/google-cloud-asset-bom/pom.xml +++ b/google-cloud-asset-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-asset-bom - 2.2.2-SNAPSHOT + 2.3.0 pom com.google.cloud @@ -64,67 +64,67 @@ com.google.api.grpc proto-google-cloud-asset-v1 - 2.2.2-SNAPSHOT + 2.3.0 com.google.api.grpc grpc-google-cloud-asset-v1 - 2.2.2-SNAPSHOT + 2.3.0 com.google.api.grpc grpc-google-cloud-asset-v1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p2beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p4beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p5beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p2beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p4beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p5beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.cloud google-cloud-asset - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/google-cloud-asset/pom.xml b/google-cloud-asset/pom.xml index 1fa168e77..77a95d92e 100644 --- a/google-cloud-asset/pom.xml +++ b/google-cloud-asset/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-asset - 2.2.2-SNAPSHOT + 2.3.0 jar Google Cloud Asset https://github.com/googleapis/java-asset @@ -11,7 +11,7 @@ com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 google-cloud-asset diff --git a/grpc-google-cloud-asset-v1/pom.xml b/grpc-google-cloud-asset-v1/pom.xml index 09128bcc9..54f151f46 100644 --- a/grpc-google-cloud-asset-v1/pom.xml +++ b/grpc-google-cloud-asset-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1 - 2.2.2-SNAPSHOT + 2.3.0 grpc-google-cloud-asset-v1 GRPC library for grpc-google-cloud-asset-v1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/grpc-google-cloud-asset-v1beta1/pom.xml b/grpc-google-cloud-asset-v1beta1/pom.xml index 68e55da7b..c3276fc74 100644 --- a/grpc-google-cloud-asset-v1beta1/pom.xml +++ b/grpc-google-cloud-asset-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1beta1 - 0.95.2-SNAPSHOT + 0.96.0 grpc-google-cloud-asset-v1beta1 GRPC library for grpc-google-cloud-asset-v1beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/grpc-google-cloud-asset-v1p1beta1/pom.xml b/grpc-google-cloud-asset-v1p1beta1/pom.xml index 2039707b0..95aa3c7a5 100644 --- a/grpc-google-cloud-asset-v1p1beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p1beta1 - 0.95.2-SNAPSHOT + 0.96.0 grpc-google-cloud-asset-v1p1beta1 GRPC library for grpc-google-cloud-asset-v1p1beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/grpc-google-cloud-asset-v1p2beta1/pom.xml b/grpc-google-cloud-asset-v1p2beta1/pom.xml index 441ad31c3..6e0988585 100644 --- a/grpc-google-cloud-asset-v1p2beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p2beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p2beta1 - 0.95.2-SNAPSHOT + 0.96.0 grpc-google-cloud-asset-v1p2beta1 GRPC library for grpc-google-cloud-asset-v1p2beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/grpc-google-cloud-asset-v1p4beta1/pom.xml b/grpc-google-cloud-asset-v1p4beta1/pom.xml index 67c6e08a6..895abf0a5 100644 --- a/grpc-google-cloud-asset-v1p4beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p4beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p4beta1 - 0.95.2-SNAPSHOT + 0.96.0 grpc-google-cloud-asset-v1p4beta1 GRPC library for grpc-google-cloud-asset-v1p4beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/grpc-google-cloud-asset-v1p5beta1/pom.xml b/grpc-google-cloud-asset-v1p5beta1/pom.xml index b6c480555..c1775781b 100644 --- a/grpc-google-cloud-asset-v1p5beta1/pom.xml +++ b/grpc-google-cloud-asset-v1p5beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-asset-v1p5beta1 - 0.95.2-SNAPSHOT + 0.96.0 grpc-google-cloud-asset-v1p5beta1 GRPC library for grpc-google-cloud-asset-v1p5beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/pom.xml b/pom.xml index a8138db28..c64be3f8d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-asset-parent pom - 2.2.2-SNAPSHOT + 2.3.0 Google Cloud Asset Parent https://github.com/googleapis/java-asset @@ -70,67 +70,67 @@ com.google.api.grpc proto-google-cloud-asset-v1 - 2.2.2-SNAPSHOT + 2.3.0 com.google.api.grpc proto-google-cloud-asset-v1p1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p2beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p4beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc proto-google-cloud-asset-v1p5beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1 - 2.2.2-SNAPSHOT + 2.3.0 com.google.api.grpc grpc-google-cloud-asset-v1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p1beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p2beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p4beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.api.grpc grpc-google-cloud-asset-v1p5beta1 - 0.95.2-SNAPSHOT + 0.96.0 com.google.cloud google-cloud-asset - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/proto-google-cloud-asset-v1/pom.xml b/proto-google-cloud-asset-v1/pom.xml index 965febb76..b239d4880 100644 --- a/proto-google-cloud-asset-v1/pom.xml +++ b/proto-google-cloud-asset-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1 - 2.2.2-SNAPSHOT + 2.3.0 proto-google-cloud-asset-v1 PROTO library for proto-google-cloud-asset-v1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/proto-google-cloud-asset-v1beta1/pom.xml b/proto-google-cloud-asset-v1beta1/pom.xml index 1babbee47..66b34815f 100644 --- a/proto-google-cloud-asset-v1beta1/pom.xml +++ b/proto-google-cloud-asset-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1beta1 - 0.95.2-SNAPSHOT + 0.96.0 proto-google-cloud-asset-v1beta1 PROTO library for proto-google-cloud-asset-v1beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/proto-google-cloud-asset-v1p1beta1/pom.xml b/proto-google-cloud-asset-v1p1beta1/pom.xml index 8b273cb20..1be0ba2d6 100644 --- a/proto-google-cloud-asset-v1p1beta1/pom.xml +++ b/proto-google-cloud-asset-v1p1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p1beta1 - 0.95.2-SNAPSHOT + 0.96.0 proto-google-cloud-asset-v1p1beta1 PROTO library for proto-google-cloud-asset-v1p1beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/proto-google-cloud-asset-v1p2beta1/pom.xml b/proto-google-cloud-asset-v1p2beta1/pom.xml index e4b5009cd..d9aa22731 100644 --- a/proto-google-cloud-asset-v1p2beta1/pom.xml +++ b/proto-google-cloud-asset-v1p2beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p2beta1 - 0.95.2-SNAPSHOT + 0.96.0 proto-google-cloud-asset-v1p2beta1 PROTO library for proto-google-cloud-asset-v1p2beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/proto-google-cloud-asset-v1p4beta1/pom.xml b/proto-google-cloud-asset-v1p4beta1/pom.xml index 68ca8e6aa..010acefc9 100644 --- a/proto-google-cloud-asset-v1p4beta1/pom.xml +++ b/proto-google-cloud-asset-v1p4beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p4beta1 - 0.95.2-SNAPSHOT + 0.96.0 proto-google-cloud-asset-v1p4beta1 PROTO library for proto-google-cloud-asset-v1p4beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/proto-google-cloud-asset-v1p5beta1/pom.xml b/proto-google-cloud-asset-v1p5beta1/pom.xml index 3173c0d73..469bbf225 100644 --- a/proto-google-cloud-asset-v1p5beta1/pom.xml +++ b/proto-google-cloud-asset-v1p5beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-asset-v1p5beta1 - 0.95.2-SNAPSHOT + 0.96.0 proto-google-cloud-asset-v1p5beta1 PROTO library for proto-google-cloud-asset-v1p4beta1 com.google.cloud google-cloud-asset-parent - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4a24fb555..a3ad1396a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-asset - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/versions.txt b/versions.txt index c45a167c8..21c65692d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,16 +1,16 @@ # Format: # module:released-version:current-version -proto-google-cloud-asset-v1:2.2.1:2.2.2-SNAPSHOT -proto-google-cloud-asset-v1p1beta1:0.95.1:0.95.2-SNAPSHOT -proto-google-cloud-asset-v1p2beta1:0.95.1:0.95.2-SNAPSHOT -proto-google-cloud-asset-v1beta1:0.95.1:0.95.2-SNAPSHOT -proto-google-cloud-asset-v1p4beta1:0.95.1:0.95.2-SNAPSHOT -proto-google-cloud-asset-v1p5beta1:0.95.1:0.95.2-SNAPSHOT -grpc-google-cloud-asset-v1:2.2.1:2.2.2-SNAPSHOT -grpc-google-cloud-asset-v1beta1:0.95.1:0.95.2-SNAPSHOT -grpc-google-cloud-asset-v1p1beta1:0.95.1:0.95.2-SNAPSHOT -grpc-google-cloud-asset-v1p2beta1:0.95.1:0.95.2-SNAPSHOT -grpc-google-cloud-asset-v1p4beta1:0.95.1:0.95.2-SNAPSHOT -grpc-google-cloud-asset-v1p5beta1:0.95.1:0.95.2-SNAPSHOT -google-cloud-asset:2.2.1:2.2.2-SNAPSHOT \ No newline at end of file +proto-google-cloud-asset-v1:2.3.0:2.3.0 +proto-google-cloud-asset-v1p1beta1:0.96.0:0.96.0 +proto-google-cloud-asset-v1p2beta1:0.96.0:0.96.0 +proto-google-cloud-asset-v1beta1:0.96.0:0.96.0 +proto-google-cloud-asset-v1p4beta1:0.96.0:0.96.0 +proto-google-cloud-asset-v1p5beta1:0.96.0:0.96.0 +grpc-google-cloud-asset-v1:2.3.0:2.3.0 +grpc-google-cloud-asset-v1beta1:0.96.0:0.96.0 +grpc-google-cloud-asset-v1p1beta1:0.96.0:0.96.0 +grpc-google-cloud-asset-v1p2beta1:0.96.0:0.96.0 +grpc-google-cloud-asset-v1p4beta1:0.96.0:0.96.0 +grpc-google-cloud-asset-v1p5beta1:0.96.0:0.96.0 +google-cloud-asset:2.3.0:2.3.0 \ No newline at end of file