From de1b27180bf93a5c9b5a9a274f9d5a2c2ff5afc1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Jul 2022 20:28:16 +0200 Subject: [PATCH 01/44] deps: update dependency com.google.http-client:google-http-client-jackson2 to v1.42.2 (#386) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.http-client:google-http-client-jackson2](https://togithub.com/googleapis/google-http-java-client) | `1.42.1` -> `1.42.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-jackson2/1.42.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-jackson2/1.42.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-jackson2/1.42.2/compatibility-slim/1.42.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.http-client:google-http-client-jackson2/1.42.2/confidence-slim/1.42.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/google-http-java-client ### [`v1.42.2`](https://togithub.com/googleapis/google-http-java-client/blob/HEAD/CHANGELOG.md#​1422-httpsgithubcomgoogleapisgoogle-http-java-clientcomparev1421v1422-2022-07-13) [Compare Source](https://togithub.com/googleapis/google-http-java-client/compare/v1.42.1...v1.42.2) ##### Bug Fixes - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/google-http-java-client/issues/1485)) ([#​1684](https://togithub.com/googleapis/google-http-java-client/issues/1684)) ([9d789f5](https://togithub.com/googleapis/google-http-java-client/commit/9d789f511b907c3970ed9845a4c092fe5458755d))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index a43094fc..726f728d 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -36,7 +36,7 @@ com.google.http-client google-http-client-jackson2 - 1.42.1 + 1.42.2 com.google.apis From 0670b461db649b2be307735aa128e8273d42d38f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Jul 2022 20:28:24 +0200 Subject: [PATCH 02/44] deps: update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220710-1.32.1 (#383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-cloudresourcemanager](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v3-rev20220619-1.32.1` -> `v3-rev20220710-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-1.32.1/compatibility-slim/v3-rev20220619-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-1.32.1/confidence-slim/v3-rev20220619-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 726f728d..a7200a09 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -26,7 +26,7 @@ com.google.apis google-api-services-cloudresourcemanager - v3-rev20220619-1.32.1 + v3-rev20220710-1.32.1 com.google.auth From e6199b3c094f606359c8e469a853a283cd82c836 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Jul 2022 20:30:11 +0200 Subject: [PATCH 03/44] deps: update dependency com.google.auth:google-auth-library-oauth2-http to v1.8.1 (#385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.auth:google-auth-library-oauth2-http](https://togithub.com/googleapis/google-auth-library-java) | `1.8.0` -> `1.8.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.8.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.8.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.8.1/compatibility-slim/1.8.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.8.1/confidence-slim/1.8.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/google-auth-library-java ### [`v1.8.1`](https://togithub.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#​181-httpsgithubcomgoogleapisgoogle-auth-library-javacomparev180v181-2022-07-13) [Compare Source](https://togithub.com/googleapis/google-auth-library-java/compare/v1.8.0...v1.8.1) ##### Bug Fixes - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/google-auth-library-java/issues/1485)) ([#​943](https://togithub.com/googleapis/google-auth-library-java/issues/943)) ([c21ec6c](https://togithub.com/googleapis/google-auth-library-java/commit/c21ec6c952b8bb8fb8bc2e2f1b260beb330a3cd2))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index a7200a09..0113a968 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.auth google-auth-library-oauth2-http - 1.8.0 + 1.8.1 com.google.http-client From 1bceda754a1b275efd799bc8231d601d6d933d23 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Jul 2022 17:49:21 +0200 Subject: [PATCH 04/44] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.0 (#387) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 10cd9ed5..3c39175f 100644 --- a/pom.xml +++ b/pom.xml @@ -122,7 +122,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.3.0 + 3.4.0 From d7beea4de4aff35f998b017c6d6136c76ec1e36b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Jul 2022 16:04:14 +0200 Subject: [PATCH 05/44] deps: update dependency io.grpc:grpc-protobuf to v1.48.0 (#388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-protobuf](https://togithub.com/grpc/grpc-java) | `1.47.0` -> `1.48.0` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.0/compatibility-slim/1.47.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.0/confidence-slim/1.47.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
grpc/grpc-java ### [`v1.48.0`](https://togithub.com/grpc/grpc-java/compare/v1.47.0...v1.48.0)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index 1c00d1b2..0ad6e12b 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -19,7 +19,7 @@ repositories { dependencies { compile 'io.grpc:grpc-stub:1.47.0' - compile 'io.grpc:grpc-protobuf:1.47.0' + compile 'io.grpc:grpc-protobuf:1.48.0' compile project(':proto-google-iam-v1') } From c76beb01ba7a59cdfe60fc498f33881faadafe89 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Jul 2022 16:10:21 +0200 Subject: [PATCH 06/44] deps: update dependency io.grpc:grpc-stub to v1.48.0 (#389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-stub](https://togithub.com/grpc/grpc-java) | `1.47.0` -> `1.48.0` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.0/compatibility-slim/1.47.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.0/confidence-slim/1.47.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
grpc/grpc-java ### [`v1.48.0`](https://togithub.com/grpc/grpc-java/compare/v1.47.0...v1.48.0)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index 0ad6e12b..bf08e692 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'io.grpc:grpc-stub:1.47.0' + compile 'io.grpc:grpc-stub:1.48.0' compile 'io.grpc:grpc-protobuf:1.48.0' compile project(':proto-google-iam-v1') } From 9bef280b9c871ad9333daa8f027b8679f91ccbb1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 21 Jul 2022 17:40:14 +0200 Subject: [PATCH 07/44] deps: update dependency com.google.apis:google-api-services-iam to v2beta-rev20220713-1.32.1 (#390) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-iam](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2beta-rev20220526-1.32.1` -> `v2beta-rev20220713-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-1.32.1/compatibility-slim/v2beta-rev20220526-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-1.32.1/confidence-slim/v2beta-rev20220526-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 0113a968..08254315 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -41,7 +41,7 @@ com.google.apis google-api-services-iam - v2beta-rev20220526-1.32.1 + v2beta-rev20220713-1.32.1 com.google.apis From 02a3c56b1143d497b98e2f437d9b36ea468e36ea Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Jul 2022 16:08:26 +0200 Subject: [PATCH 08/44] deps: update dependency com.google.protobuf:protobuf-java to v3.21.3 (#391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.protobuf:protobuf-java](https://developers.google.com/protocol-buffers/) ([source](https://togithub.com/protocolbuffers/protobuf)) | `3.21.2` -> `3.21.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.3/compatibility-slim/3.21.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.3/confidence-slim/3.21.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
protocolbuffers/protobuf ### [`v3.21.3`](https://togithub.com/protocolbuffers/protobuf/compare/v3.21.2...v3.21.3)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- proto-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-google-iam-v1/build.gradle b/proto-google-iam-v1/build.gradle index b4fb1e55..6d57d724 100644 --- a/proto-google-iam-v1/build.gradle +++ b/proto-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'com.google.protobuf:protobuf-java:3.21.2' + compile 'com.google.protobuf:protobuf-java:3.21.3' compile 'com.google.api:api-common:2.2.1' compile project(':proto-google-common-protos') } From 38994660eb9c19930af8faa44ffe4e2b6953e826 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Jul 2022 21:28:16 +0200 Subject: [PATCH 09/44] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.2 (#392) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.1` -> `1.5.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.2/compatibility-slim/1.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.2/confidence-slim/1.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.5.2`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​152-httpsgithubcomgoogleapisjava-shared-configcomparev151v152-2022-07-25) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.1...v1.5.2) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v10 ([#​435](https://togithub.com/googleapis/java-shared-config/issues/435)) ([bfc8ce1](https://togithub.com/googleapis/java-shared-config/commit/bfc8ce1deca6292147d002d3afe22a09840aa5d6)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#​488](https://togithub.com/googleapis/java-shared-config/issues/488)) ([39b91ee](https://togithub.com/googleapis/java-shared-config/commit/39b91ee1283f0a5fbbe63e8bfd1ec97ab4ab377e)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#​489](https://togithub.com/googleapis/java-shared-config/issues/489)) ([cc3bcfa](https://togithub.com/googleapis/java-shared-config/commit/cc3bcfa2d6717441a8d5b5048fa78c2cf7aabf2b))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3c39175f..257aa18c 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.1 + 1.5.2 From f4c649b67c0a8fa950487b3e3b2f10ab85136165 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Jul 2022 21:00:26 +0200 Subject: [PATCH 10/44] deps: update dependency com.google.protobuf:protobuf-java to v3.21.4 (#393) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.protobuf:protobuf-java](https://developers.google.com/protocol-buffers/) ([source](https://togithub.com/protocolbuffers/protobuf)) | `3.21.3` -> `3.21.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.4/compatibility-slim/3.21.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.4/confidence-slim/3.21.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- proto-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-google-iam-v1/build.gradle b/proto-google-iam-v1/build.gradle index 6d57d724..7b165054 100644 --- a/proto-google-iam-v1/build.gradle +++ b/proto-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'com.google.protobuf:protobuf-java:3.21.3' + compile 'com.google.protobuf:protobuf-java:3.21.4' compile 'com.google.api:api-common:2.2.1' compile project(':proto-google-common-protos') } From 3485b86c4f5f21e0fe0015aedc7701581f180f27 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 29 Jul 2022 23:52:20 +0200 Subject: [PATCH 11/44] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.3 (#394) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.2` -> `1.5.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/compatibility-slim/1.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/confidence-slim/1.5.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.5.3`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​153-httpsgithubcomgoogleapisjava-shared-configcomparev152v153-2022-07-27) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.2...v1.5.3) ##### Dependencies - update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#​497](https://togithub.com/googleapis/java-shared-config/issues/497)) ([1fc6ab4](https://togithub.com/googleapis/java-shared-config/commit/1fc6ab445624cd4f9c8b161d109f346a9e5ed09a)) - Update doclet to latest version 1.6.0 ([38fb7c3](https://togithub.com/googleapis/java-shared-config/commit/38fb7c3957fb6c9b2da10f9e463cc93a8b80a3a4))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 257aa18c..d29435ac 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.2 + 1.5.3 From a88edd61e1a66c5f48185dd5e8a2a61e5e9a002e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 30 Jul 2022 02:30:20 +0200 Subject: [PATCH 12/44] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3 (#395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.13.0` -> `3.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.0/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.0/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​300-httpsgithubcomgoogleapisjava-shared-dependenciescomparev2130v300-2022-07-29) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.13.0...v3.0.0) ##### Bug Fixes - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/java-shared-dependencies/issues/1485)) ([#​738](https://togithub.com/googleapis/java-shared-dependencies/issues/738)) ([11bc8f8](https://togithub.com/googleapis/java-shared-dependencies/commit/11bc8f81f28be88a97fdeafca21724e33638770c)) ##### Dependencies - update dependency com.google.api-client:google-api-client-bom to v1.35.2 ([#​729](https://togithub.com/googleapis/java-shared-dependencies/issues/729)) ([1fa59af](https://togithub.com/googleapis/java-shared-dependencies/commit/1fa59af80abb9f278f57658c10158567e825fec6)) - update dependency com.google.api-client:google-api-client-bom to v2 ([#​746](https://togithub.com/googleapis/java-shared-dependencies/issues/746)) ([2dcb2e0](https://togithub.com/googleapis/java-shared-dependencies/commit/2dcb2e071e0ba0eea21bb575bd13cd559d4a1ca6)) - update dependency com.google.api.grpc:grpc-google-common-protos to v2.9.2 ([#​741](https://togithub.com/googleapis/java-shared-dependencies/issues/741)) ([3352d6c](https://togithub.com/googleapis/java-shared-dependencies/commit/3352d6c36111c04e3f6f3e6360470fa3efb10d8f)) - update dependency com.google.auth:google-auth-library-bom to v1.8.0 ([#​726](https://togithub.com/googleapis/java-shared-dependencies/issues/726)) ([2c5d64c](https://togithub.com/googleapis/java-shared-dependencies/commit/2c5d64c127db8384e49113acfeac6928716a2d7f)) - update dependency com.google.auth:google-auth-library-bom to v1.8.1 ([#​742](https://togithub.com/googleapis/java-shared-dependencies/issues/742)) ([4f53527](https://togithub.com/googleapis/java-shared-dependencies/commit/4f53527bda7f40896711b7c1d1c02453321ffbc8)) - update dependency com.google.cloud:first-party-dependencies to v2 ([#​747](https://togithub.com/googleapis/java-shared-dependencies/issues/747)) ([e970ac0](https://togithub.com/googleapis/java-shared-dependencies/commit/e970ac0599941c825dc2516146a7c6673e68a9b9)) - update dependency com.google.cloud:grpc-gcp to v1.2.1 ([#​751](https://togithub.com/googleapis/java-shared-dependencies/issues/751)) ([b3284b6](https://togithub.com/googleapis/java-shared-dependencies/commit/b3284b6ee52a96a6ea8696a05a94443df9ee5b9f)) - update dependency com.google.cloud:third-party-dependencies to v2 ([#​748](https://togithub.com/googleapis/java-shared-dependencies/issues/748)) ([573b41a](https://togithub.com/googleapis/java-shared-dependencies/commit/573b41a69504372741cbeb01dd200e7c71967186)) - update dependency com.google.http-client:google-http-client-bom to v1.42.1 ([#​730](https://togithub.com/googleapis/java-shared-dependencies/issues/730)) ([6b47126](https://togithub.com/googleapis/java-shared-dependencies/commit/6b47126686b603a5d112e097ce6aa3a1880daf6f)) - update dependency com.google.http-client:google-http-client-bom to v1.42.2 ([#​749](https://togithub.com/googleapis/java-shared-dependencies/issues/749)) ([299d7b0](https://togithub.com/googleapis/java-shared-dependencies/commit/299d7b0d4920644e2c3070d12dd1d97da17a5e88)) - update dependency com.google.protobuf:protobuf-bom to v3.21.2 ([#​722](https://togithub.com/googleapis/java-shared-dependencies/issues/722)) ([7a96b12](https://togithub.com/googleapis/java-shared-dependencies/commit/7a96b1259a526b63e9376fd6cc18b27cddeb5f0f)) - update dependency com.google.protobuf:protobuf-bom to v3.21.3 ([#​756](https://togithub.com/googleapis/java-shared-dependencies/issues/756)) ([3d0bac2](https://togithub.com/googleapis/java-shared-dependencies/commit/3d0bac23487aebb94267c0708f41ff6c02a028a4)) - update dependency com.google.protobuf:protobuf-bom to v3.21.4 ([#​759](https://togithub.com/googleapis/java-shared-dependencies/issues/759)) ([5a54ef1](https://togithub.com/googleapis/java-shared-dependencies/commit/5a54ef1a2d56244166d4fcc46041d62c0dc4b411)) - update dependency io.grpc:grpc-bom to v1.48.0 ([#​752](https://togithub.com/googleapis/java-shared-dependencies/issues/752)) ([20ac908](https://togithub.com/googleapis/java-shared-dependencies/commit/20ac908932a5e7c8e581bdfcd68579d7e1cedd5f)) - update dependency org.checkerframework:checker-qual to v3.23.0 ([#​736](https://togithub.com/googleapis/java-shared-dependencies/issues/736)) ([fc01d8f](https://togithub.com/googleapis/java-shared-dependencies/commit/fc01d8f93f391f12fdb800d5006f0b4505832eeb)) - update gax.version to v2.18.3 ([#​731](https://togithub.com/googleapis/java-shared-dependencies/issues/731)) ([e8ee554](https://togithub.com/googleapis/java-shared-dependencies/commit/e8ee554707acb2f71c739d08e2ff02fbe43ffa52)) - update gax.version to v2.18.4 ([#​735](https://togithub.com/googleapis/java-shared-dependencies/issues/735)) ([11c7415](https://togithub.com/googleapis/java-shared-dependencies/commit/11c74152a84697924de3a0e838b05f606c3098f7)) - update gax.version to v2.18.5 ([#​758](https://togithub.com/googleapis/java-shared-dependencies/issues/758)) ([7469fc1](https://togithub.com/googleapis/java-shared-dependencies/commit/7469fc1cc5095b39a5738e60156711a268f6e052)) - update gax.version to v2.18.6 ([#​763](https://togithub.com/googleapis/java-shared-dependencies/issues/763)) ([b5ca2f7](https://togithub.com/googleapis/java-shared-dependencies/commit/b5ca2f7b4d81c705823253f4f03363a32d2be48b)) - update google.common-protos.version to v2.9.1 ([#​724](https://togithub.com/googleapis/java-shared-dependencies/issues/724)) ([5213dbb](https://togithub.com/googleapis/java-shared-dependencies/commit/5213dbbfa9c9b73d2420ec2be7782f16c9c4955f)) - update google.core.version to v2.8.1 ([#​725](https://togithub.com/googleapis/java-shared-dependencies/issues/725)) ([575858a](https://togithub.com/googleapis/java-shared-dependencies/commit/575858a60f76e46bbc2a2435c2b6c01c8f4ab681)) - update google.core.version to v2.8.3 ([#​760](https://togithub.com/googleapis/java-shared-dependencies/issues/760)) ([cb10ae4](https://togithub.com/googleapis/java-shared-dependencies/commit/cb10ae4b76939215ea465af74163b3d4ad65a548)) - update google.core.version to v2.8.4 ([#​762](https://togithub.com/googleapis/java-shared-dependencies/issues/762)) ([821daaf](https://togithub.com/googleapis/java-shared-dependencies/commit/821daafefdbcfdfe6e363e580747538096a562ef)) - update google.core.version to v2.8.5 ([#​764](https://togithub.com/googleapis/java-shared-dependencies/issues/764)) ([a1f8f50](https://togithub.com/googleapis/java-shared-dependencies/commit/a1f8f501b54143a2cec8e72efd4ceb3ce47f13ae)) - update iam.version to v1.5.0 ([#​732](https://togithub.com/googleapis/java-shared-dependencies/issues/732)) ([9dce0e5](https://togithub.com/googleapis/java-shared-dependencies/commit/9dce0e5199c1e425119adc804304958f58003a27)) - update iam.version to v1.5.1 ([#​737](https://togithub.com/googleapis/java-shared-dependencies/issues/737)) ([df39168](https://togithub.com/googleapis/java-shared-dependencies/commit/df391685d42fcb1b04f03ab1380a594893bdce37)) - update iam.version to v1.5.2 ([#​743](https://togithub.com/googleapis/java-shared-dependencies/issues/743)) ([cdde697](https://togithub.com/googleapis/java-shared-dependencies/commit/cdde697f25a89fc8c2ec7eae6b7c54f69977bb1c))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d29435ac..1f67ce26 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-shared-dependencies - 2.13.0 + 3.0.0 pom import From 4917a59ae856825e6e96a5b3ca0d766b8a931de6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 20:44:26 +0200 Subject: [PATCH 13/44] deps: update dependency io.grpc:grpc-stub to v1.48.1 (#398) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-stub](https://togithub.com/grpc/grpc-java) | `1.48.0` -> `1.48.1` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.1/compatibility-slim/1.48.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.48.1/confidence-slim/1.48.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
grpc/grpc-java ### [`v1.48.1`](https://togithub.com/grpc/grpc-java/compare/v1.48.0...v1.48.1)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index bf08e692..d889a888 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'io.grpc:grpc-stub:1.48.0' + compile 'io.grpc:grpc-stub:1.48.1' compile 'io.grpc:grpc-protobuf:1.48.0' compile project(':proto-google-iam-v1') } From ec96383900c271ddf96a58772ff459c6879c106f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 20:44:30 +0200 Subject: [PATCH 14/44] deps: update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220710-2.0.0 (#396) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-cloudresourcemanager](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v3-rev20220710-1.32.1` -> `v3-rev20220710-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-2.0.0/compatibility-slim/v3-rev20220710-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220710-2.0.0/confidence-slim/v3-rev20220710-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 08254315..6a9615cc 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -26,7 +26,7 @@ com.google.apis google-api-services-cloudresourcemanager - v3-rev20220710-1.32.1 + v3-rev20220710-2.0.0 com.google.auth From 512a6554067bbbe9ac400f833a0a8cd4bfaef785 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 20:52:33 +0200 Subject: [PATCH 15/44] deps: update dependency io.grpc:grpc-protobuf to v1.48.1 (#397) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-protobuf](https://togithub.com/grpc/grpc-java) | `1.48.0` -> `1.48.1` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.1/compatibility-slim/1.48.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.48.1/confidence-slim/1.48.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
grpc/grpc-java ### [`v1.48.1`](https://togithub.com/grpc/grpc-java/compare/v1.48.0...v1.48.1)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index d889a888..0cadb71e 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -19,7 +19,7 @@ repositories { dependencies { compile 'io.grpc:grpc-stub:1.48.1' - compile 'io.grpc:grpc-protobuf:1.48.0' + compile 'io.grpc:grpc-protobuf:1.48.1' compile project(':proto-google-iam-v1') } From bf814a9faf878195676937cfe793b4a20fff6f06 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 3 Aug 2022 00:16:23 +0200 Subject: [PATCH 16/44] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.1 (#399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.0` -> `3.0.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/compatibility-slim/3.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/confidence-slim/3.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​301-httpsgithubcomgoogleapisjava-shared-dependenciescomparev300v301-2022-08-02) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.0...v3.0.1) ##### Dependencies - update dependency com.google.code.gson:gson to v2.9.1 ([#​766](https://togithub.com/googleapis/java-shared-dependencies/issues/766)) ([f7b2b06](https://togithub.com/googleapis/java-shared-dependencies/commit/f7b2b06b80e3e95ff8ab9b1d6a2638ef3069298a)) - update gax.version to v2.18.7 ([#​767](https://togithub.com/googleapis/java-shared-dependencies/issues/767)) ([9650368](https://togithub.com/googleapis/java-shared-dependencies/commit/96503682e98cdf348ea2c1365a03a60f4322c712)) - update google.core.version to v2.8.6 ([#​770](https://togithub.com/googleapis/java-shared-dependencies/issues/770)) ([cfd4377](https://togithub.com/googleapis/java-shared-dependencies/commit/cfd4377dc178cebb4724065d55d185ce03988d55))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f67ce26..ab53cf34 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.0 + 3.0.1 pom import From aa4e5b6ec5af98925c4353c9393e33c423c67a60 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 3 Aug 2022 16:58:29 +0200 Subject: [PATCH 17/44] deps: update dependency com.google.auth:google-auth-library-oauth2-http to v1.9.0 (#400) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.auth:google-auth-library-oauth2-http](https://togithub.com/googleapis/google-auth-library-java) | `1.8.1` -> `1.9.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.9.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.9.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.9.0/compatibility-slim/1.8.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.9.0/confidence-slim/1.8.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/google-auth-library-java ### [`v1.9.0`](https://togithub.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#​190-httpsgithubcomgoogleapisgoogle-auth-library-javacomparev181v190-2022-08-02) [Compare Source](https://togithub.com/googleapis/google-auth-library-java/compare/v1.8.1...v1.9.0) ##### Features - integration tests for pluggable auth ([#​939](https://togithub.com/googleapis/google-auth-library-java/issues/939)) ([22f37aa](https://togithub.com/googleapis/google-auth-library-java/commit/22f37aa687b7ffb4209a131860ccdd02f6fc4d42)) ##### Bug Fixes - expiration time of the ImpersonatedCredentials token depending on the current host's timezone ([#​932](https://togithub.com/googleapis/google-auth-library-java/issues/932)) ([73af08a](https://togithub.com/googleapis/google-auth-library-java/commit/73af08a1c5f14e18936e9dbd3d1ba29c2675961d)) ##### Documentation - update wif documentation with enable-imdsv2 flag ([#​940](https://togithub.com/googleapis/google-auth-library-java/issues/940)) ([acc1ce3](https://togithub.com/googleapis/google-auth-library-java/commit/acc1ce3603435f1c0cf23b8606af71b05e566f2f))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 6a9615cc..67cb9532 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.auth google-auth-library-oauth2-http - 1.8.1 + 1.9.0 com.google.http-client From 39605e5b1cb4ee9fea068e36a6452e02710ae03d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Aug 2022 19:10:24 +0200 Subject: [PATCH 18/44] deps: update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220731-2.0.0 (#402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-cloudresourcemanager](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v3-rev20220710-2.0.0` -> `v3-rev20220731-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220731-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220731-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220731-2.0.0/compatibility-slim/v3-rev20220710-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220731-2.0.0/confidence-slim/v3-rev20220710-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 67cb9532..c193d8f5 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -26,7 +26,7 @@ com.google.apis google-api-services-cloudresourcemanager - v3-rev20220710-2.0.0 + v3-rev20220731-2.0.0 com.google.auth From 8879c28cac3543c441be636da626bcc3c10509da Mon Sep 17 00:00:00 2001 From: Sita Lakshmi Sangameswaran Date: Fri, 5 Aug 2022 04:38:25 +0530 Subject: [PATCH 19/44] docs(samples): update param values (#401) --- .../cloud-client/snippets/src/main/java/CreateDenyPolicy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java b/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java index a41b6fc1..5cbc966e 100644 --- a/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java +++ b/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java @@ -36,10 +36,10 @@ public static void main(String[] args) throws IOException, ExecutionException, InterruptedException, TimeoutException { // TODO(developer): Replace these variables before running the sample. // ID or number of the Google Cloud project you want to use. - String projectId = "sitalakshmi-deny"; + String projectId = "your-google-cloud-project-id"; // Specify the id of the Deny policy you want to create. - String policyId = "deny-policy-id-1"; + String policyId = "deny-policy-id"; createDenyPolicy(projectId, policyId); } From c21d4e75ceab5a655b81927328ed4522caeefddc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 12:46:11 +0000 Subject: [PATCH 20/44] chore(main): release 1.5.3-SNAPSHOT (#384) :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). See [documentation](https://github.com/googleapis/release-please#release-please). --- google-iam-policy/pom.xml | 4 ++-- grpc-google-iam-v1/pom.xml | 4 ++-- grpc-google-iam-v2beta/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-iam-v1/pom.xml | 4 ++-- proto-google-iam-v2beta/pom.xml | 4 ++-- versions.txt | 10 +++++----- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/google-iam-policy/pom.xml b/google-iam-policy/pom.xml index 9d3c1495..ea654d67 100644 --- a/google-iam-policy/pom.xml +++ b/google-iam-policy/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-iam-policy - 1.5.2 + 1.5.3-SNAPSHOT jar Google IAM Policy https://github.com/googleapis/java-eventarc @@ -11,7 +11,7 @@ com.google.cloud google-iam-parent - 1.5.2 + 1.5.3-SNAPSHOT google-iam-policy diff --git a/grpc-google-iam-v1/pom.xml b/grpc-google-iam-v1/pom.xml index 82ca5648..825a4ca0 100644 --- a/grpc-google-iam-v1/pom.xml +++ b/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.5.2 + 1.5.3-SNAPSHOT grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.5.2 + 1.5.3-SNAPSHOT diff --git a/grpc-google-iam-v2beta/pom.xml b/grpc-google-iam-v2beta/pom.xml index 69c4bb8b..909fe96e 100644 --- a/grpc-google-iam-v2beta/pom.xml +++ b/grpc-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2beta - 1.5.2 + 1.5.3-SNAPSHOT grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.2 + 1.5.3-SNAPSHOT diff --git a/pom.xml b/pom.xml index ab53cf34..dfe9285a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.5.2 + 1.5.3-SNAPSHOT Google IAM Parent https://github.com/googleapis/java-iam @@ -77,27 +77,27 @@ com.google.cloud google-iam-policy - 1.5.2 + 1.5.3-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.5.2 + 1.5.3-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.5.2 + 1.5.3-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.5.2 + 1.5.3-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.5.2 + 1.5.3-SNAPSHOT diff --git a/proto-google-iam-v1/pom.xml b/proto-google-iam-v1/pom.xml index 2e9ce523..c1e7b535 100644 --- a/proto-google-iam-v1/pom.xml +++ b/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.5.2 + 1.5.3-SNAPSHOT proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.2 + 1.5.3-SNAPSHOT diff --git a/proto-google-iam-v2beta/pom.xml b/proto-google-iam-v2beta/pom.xml index 9f30461e..28a596c9 100644 --- a/proto-google-iam-v2beta/pom.xml +++ b/proto-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2beta - 1.5.2 + 1.5.3-SNAPSHOT proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.2 + 1.5.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 6e732222..8f0502c0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -proto-google-iam-v1:1.5.2:1.5.2 -grpc-google-iam-v1:1.5.2:1.5.2 -proto-google-iam-v2beta:1.5.2:1.5.2 -grpc-google-iam-v2beta:1.5.2:1.5.2 -google-iam-policy:1.5.2:1.5.2 +proto-google-iam-v1:1.5.2:1.5.3-SNAPSHOT +grpc-google-iam-v1:1.5.2:1.5.3-SNAPSHOT +proto-google-iam-v2beta:1.5.2:1.5.3-SNAPSHOT +grpc-google-iam-v2beta:1.5.2:1.5.3-SNAPSHOT +google-iam-policy:1.5.2:1.5.3-SNAPSHOT From 475fa93c1b5affb19eec36856e719041d5bf56af Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 17:44:22 +0200 Subject: [PATCH 21/44] deps: update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220807-2.0.0 (#407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-cloudresourcemanager](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v3-rev20220731-2.0.0` -> `v3-rev20220807-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220807-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220807-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220807-2.0.0/compatibility-slim/v3-rev20220731-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220807-2.0.0/confidence-slim/v3-rev20220731-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index c193d8f5..9f3b5dce 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -26,7 +26,7 @@ com.google.apis google-api-services-cloudresourcemanager - v3-rev20220731-2.0.0 + v3-rev20220807-2.0.0 com.google.auth From 87ce74b3711b7efc9c4e075199f7d9739896973e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 17:56:29 +0200 Subject: [PATCH 22/44] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.0 (#409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.0.0` -> `26.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.0/compatibility-slim/26.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.0/confidence-slim/26.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 9f3b5dce..2d5fe87d 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -72,7 +72,7 @@ com.google.cloud import pom - 26.0.0 + 26.1.0 From 66b27cb9722cac68af7844447524f149fb08b3b0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 18:18:20 +0200 Subject: [PATCH 23/44] deps: update dependency com.google.protobuf:protobuf-java to v3.21.5 (#405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.protobuf:protobuf-java](https://developers.google.com/protocol-buffers/) ([source](https://togithub.com/protocolbuffers/protobuf)) | `3.21.4` -> `3.21.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.5/compatibility-slim/3.21.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.protobuf:protobuf-java/3.21.5/confidence-slim/3.21.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- proto-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-google-iam-v1/build.gradle b/proto-google-iam-v1/build.gradle index 7b165054..be64827e 100644 --- a/proto-google-iam-v1/build.gradle +++ b/proto-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'com.google.protobuf:protobuf-java:3.21.4' + compile 'com.google.protobuf:protobuf-java:3.21.5' compile 'com.google.api:api-common:2.2.1' compile project(':proto-google-common-protos') } From 56284df32ee657a5055e6dea3bd7b25772c218ea Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 18:48:21 +0200 Subject: [PATCH 24/44] deps: update dependency com.google.auth:google-auth-library-oauth2-http to v1.10.0 (#406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.auth:google-auth-library-oauth2-http](https://togithub.com/googleapis/google-auth-library-java) | `1.9.0` -> `1.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.10.0/compatibility-slim/1.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.10.0/confidence-slim/1.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/google-auth-library-java ### [`v1.10.0`](https://togithub.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#​1100-httpsgithubcomgoogleapisgoogle-auth-library-javacomparev190v1100-2022-08-05) [Compare Source](https://togithub.com/googleapis/google-auth-library-java/compare/v1.9.0...v1.10.0) ##### Features - workforce identity federation for pluggable auth ([#​959](https://togithub.com/googleapis/google-auth-library-java/issues/959)) ([7f2c535](https://togithub.com/googleapis/google-auth-library-java/commit/7f2c535ab7c842a672d6761f4cd80df88e1a37ed)) ##### Bug Fixes - updates executable response spec for executable-sourced credentials ([#​955](https://togithub.com/googleapis/google-auth-library-java/issues/955)) ([48ff83d](https://togithub.com/googleapis/google-auth-library-java/commit/48ff83dc68e29dcae07fdea963cbbe5525f86a89)) ##### Documentation - **samples:** added auth samples and tests ([#​927](https://togithub.com/googleapis/google-auth-library-java/issues/927)) ([32c717f](https://togithub.com/googleapis/google-auth-library-java/commit/32c717fdf1a721f3e7ca3d75f03fcc229923689c))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 2d5fe87d..b9e512fb 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.auth google-auth-library-oauth2-http - 1.9.0 + 1.10.0 com.google.http-client From d3eeae8c5563178e7029a5f1191c737c988b57ae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 20:54:18 +0200 Subject: [PATCH 25/44] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.4.1 (#410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-javadoc-plugin](https://maven.apache.org/plugins/) ([source](https://togithub.com/apache/maven-javadoc-plugin)) | `3.4.0` -> `3.4.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dfe9285a..1cca39f9 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 html From 7a8270b691b5c749c90185659bd3a51480c3e1c4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 21:12:21 +0200 Subject: [PATCH 26/44] deps: update dependency com.google.apis:google-api-services-iam to v2beta-rev20220713-2.0.0 (#403) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-iam](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2beta-rev20220713-1.32.1` -> `v2beta-rev20220713-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-2.0.0/compatibility-slim/v2beta-rev20220713-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iam/v2beta-rev20220713-2.0.0/confidence-slim/v2beta-rev20220713-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index b9e512fb..4ee2f683 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -41,7 +41,7 @@ com.google.apis google-api-services-iam - v2beta-rev20220713-1.32.1 + v2beta-rev20220713-2.0.0 com.google.apis From 446ab1d3ff47d0c6edf409afc985040eb014ad8c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 23:34:17 +0200 Subject: [PATCH 27/44] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.1 (#411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-project-info-reports-plugin](https://maven.apache.org/plugins/) | `3.4.0` -> `3.4.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1cca39f9..25f33d80 100644 --- a/pom.xml +++ b/pom.xml @@ -122,7 +122,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.0 + 3.4.1 From ee3537d763c389d25d887fb1b2cfc61ff4101d65 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Aug 2022 15:50:22 +0200 Subject: [PATCH 28/44] deps: update dependency com.google.apis:google-api-services-iamcredentials to v1-rev20211203-2.0.0 (#404) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-iamcredentials](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v1-rev20211203-1.32.1` -> `v1-rev20211203-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iamcredentials/v1-rev20211203-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iamcredentials/v1-rev20211203-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iamcredentials/v1-rev20211203-2.0.0/compatibility-slim/v1-rev20211203-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-iamcredentials/v1-rev20211203-2.0.0/confidence-slim/v1-rev20211203-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 4ee2f683..90492bf7 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -46,7 +46,7 @@ com.google.apis google-api-services-iamcredentials - v1-rev20211203-1.32.1 + v1-rev20211203-2.0.0 From 93ac43deb5a663bd22b5d14f8ba7a4bdff6928cd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 24 Aug 2022 16:22:31 +0200 Subject: [PATCH 29/44] deps: update dependency io.grpc:grpc-protobuf to v1.49.0 (#413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-protobuf](https://togithub.com/grpc/grpc-java) | `1.48.1` -> `1.49.0` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.0/compatibility-slim/1.48.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.0/confidence-slim/1.48.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index 0cadb71e..1b69309a 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -19,7 +19,7 @@ repositories { dependencies { compile 'io.grpc:grpc-stub:1.48.1' - compile 'io.grpc:grpc-protobuf:1.48.1' + compile 'io.grpc:grpc-protobuf:1.49.0' compile project(':proto-google-iam-v1') } From 1d9846000bf41f20907dfcbc11574e88f91cc8f8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 24 Aug 2022 16:28:15 +0200 Subject: [PATCH 30/44] deps: update dependency io.grpc:grpc-stub to v1.49.0 (#414) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-stub](https://togithub.com/grpc/grpc-java) | `1.48.1` -> `1.49.0` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.0/compatibility-slim/1.48.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.0/confidence-slim/1.48.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
grpc/grpc-java ### [`v1.49.0`](https://togithub.com/grpc/grpc-java/compare/v1.48.1...v1.49.0) [Compare Source](https://togithub.com/grpc/grpc-java/compare/v1.48.1...v1.49.0)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index 1b69309a..ef0395bd 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'io.grpc:grpc-stub:1.48.1' + compile 'io.grpc:grpc-stub:1.49.0' compile 'io.grpc:grpc-protobuf:1.49.0' compile project(':proto-google-iam-v1') } From f4f695f95ad0cfad7a40683e84f465d1526f4935 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Thu, 25 Aug 2022 17:09:57 -0400 Subject: [PATCH 31/44] chore: Remove CLIRR job as required (#415) --- .github/sync-repo-settings.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6f09d695..dd5626f3 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -11,7 +11,6 @@ branchProtectionRules: - dependencies (8) - dependencies (11) - lint - - clirr - units (8) - units (11) - 'Kokoro - Test: Integration' @@ -26,7 +25,6 @@ branchProtectionRules: - dependencies (8) - dependencies (11) - lint - - clirr - units (7) - units (8) - units (11) From 58948731feee6462ae75f6fe11c31e36e9ec6fce Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:12:17 +0000 Subject: [PATCH 32/44] feat: Update the public IAM Deny v2beta API (#412) - [ ] Regenerate this pull request now. BREAKING CHANGE: remove google.api.resource_reference annotations PiperOrigin-RevId: 468493946 Source-Link: https://github.com/googleapis/googleapis/commit/fb22ccd6ce5b8d66790d71b50a3b6fe69fdc3ab0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fd818d2d7b17ade74aa84d7384e13cbe40ba320d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ4MThkMmQ3YjE3YWRlNzRhYTg0ZDczODRlMTNjYmU0MGJhMzIwZCJ9 --- google-iam-policy/pom.xml | 16 + .../com/google/iam/v2beta/PoliciesClient.java | 125 ++--- .../google/iam/v2beta/PoliciesSettings.java | 23 +- .../com/google/iam/v2beta/gapic_metadata.json | 4 +- .../com/google/iam/v2beta/package-info.java | 2 +- .../stub/HttpJsonPoliciesCallableFactory.java | 105 ++++ .../iam/v2beta/stub/HttpJsonPoliciesStub.java | 474 ++++++++++++++++++ .../google/iam/v2beta/stub/PoliciesStub.java | 6 +- .../iam/v2beta/stub/PoliciesStubSettings.java | 52 +- .../v2beta/PoliciesClientHttpJsonTest.java | 393 +++++++++++++++ .../google/iam/v2beta/PoliciesClientTest.java | 114 +---- proto-google-iam-v2beta/pom.xml | 8 - .../iam/v2beta/DeletePolicyRequest.java | 28 +- .../v2beta/DeletePolicyRequestOrBuilder.java | 8 +- .../java/com/google/iam/v2beta/DenyRule.java | 26 +- .../google/iam/v2beta/DenyRuleOrBuilder.java | 8 +- .../com/google/iam/v2beta/DenyRuleProto.java | 8 +- .../google/iam/v2beta/GetPolicyRequest.java | 28 +- .../iam/v2beta/GetPolicyRequestOrBuilder.java | 8 +- .../com/google/iam/v2beta/PolicyName.java | 168 ------- .../com/google/iam/v2beta/PolicyProto.java | 116 ++--- .../main/proto/google/iam/v2beta/deny.proto | 4 +- .../main/proto/google/iam/v2beta/policy.proto | 22 +- 23 files changed, 1215 insertions(+), 531 deletions(-) create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesCallableFactory.java create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java create mode 100644 google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientHttpJsonTest.java delete mode 100644 proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyName.java diff --git a/google-iam-policy/pom.xml b/google-iam-policy/pom.xml index ea654d67..d720bd06 100644 --- a/google-iam-policy/pom.xml +++ b/google-iam-policy/pom.xml @@ -58,6 +58,10 @@ com.google.api gax-grpc
+ + com.google.api + gax-httpjson + org.threeten threetenbp @@ -77,12 +81,24 @@ test + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test +
diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java index 582c71e4..8cc89dce 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,7 +32,6 @@ import com.google.iam.v2beta.stub.PoliciesStub; import com.google.iam.v2beta.stub.PoliciesStubSettings; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -48,7 +48,7 @@ * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { - * PolicyName name = PolicyName.of("[POLICY]"); + * String name = "name3373707"; * Policy response = policiesClient.getPolicy(name); * } * } @@ -101,6 +101,20 @@ * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PoliciesSettings policiesSettings =
+ *     PoliciesSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             PoliciesSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -108,7 +122,8 @@ public class PoliciesClient implements BackgroundResource { private final PoliciesSettings settings; private final PoliciesStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of PoliciesClient with default settings. */ public static final PoliciesClient create() throws IOException { @@ -138,13 +153,17 @@ public static final PoliciesClient create(PoliciesStub stub) { protected PoliciesClient(PoliciesSettings settings) throws IOException { this.settings = settings; this.stub = ((PoliciesStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected PoliciesClient(PoliciesStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final PoliciesSettings getSettings() { @@ -159,10 +178,19 @@ public PoliciesStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the policies of the specified kind that are attached to a resource. @@ -305,37 +333,7 @@ public final UnaryCallable listPolici * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { - * PolicyName name = PolicyName.of("[POLICY]"); - * Policy response = policiesClient.getPolicy(name); - * } - * } - * - * @param name Required. The resource name of the policy to retrieve. Format: - * `policies/{attachment_point}/denypolicies/{policy_id}` - *

Use the URL-encoded full resource name, which means that the forward-slash character, - * `/`, must be written as `%2F`. For example, - * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - *

For organizations and folders, use the numeric ID in the full resource name. For - * projects, you can use the alphanumeric or the numeric ID. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getPolicy(PolicyName name) { - GetPolicyRequest request = - GetPolicyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets a policy. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
-   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
-   *   String name = PolicyName.of("[POLICY]").toString();
+   *   String name = "name3373707";
    *   Policy response = policiesClient.getPolicy(name);
    * }
    * }
@@ -364,8 +362,7 @@ public final Policy getPolicy(String name) { * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { - * GetPolicyRequest request = - * GetPolicyRequest.newBuilder().setName(PolicyName.of("[POLICY]").toString()).build(); + * GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build(); * Policy response = policiesClient.getPolicy(request); * } * } @@ -387,8 +384,7 @@ public final Policy getPolicy(GetPolicyRequest request) { * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { - * GetPolicyRequest request = - * GetPolicyRequest.newBuilder().setName(PolicyName.of("[POLICY]").toString()).build(); + * GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build(); * ApiFuture future = policiesClient.getPolicyCallable().futureCall(request); * // Do something. * Policy response = future.get(); @@ -630,37 +626,7 @@ public final UnaryCallable updatePolicyCallable( * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { - * PolicyName name = PolicyName.of("[POLICY]"); - * Policy response = policiesClient.deletePolicyAsync(name).get(); - * } - * } - * - * @param name Required. The resource name of the policy to delete. Format: - * `policies/{attachment_point}/denypolicies/{policy_id}` - *

Use the URL-encoded full resource name, which means that the forward-slash character, - * `/`, must be written as `%2F`. For example, - * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - *

For organizations and folders, use the numeric ID in the full resource name. For - * projects, you can use the alphanumeric or the numeric ID. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture deletePolicyAsync(PolicyName name) { - DeletePolicyRequest request = - DeletePolicyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deletePolicyAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a policy. This action is permanent. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
-   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
-   *   String name = PolicyName.of("[POLICY]").toString();
+   *   String name = "name3373707";
    *   Policy response = policiesClient.deletePolicyAsync(name).get();
    * }
    * }
@@ -690,10 +656,7 @@ public final OperationFuture deletePolicyAsync( * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { * DeletePolicyRequest request = - * DeletePolicyRequest.newBuilder() - * .setName(PolicyName.of("[POLICY]").toString()) - * .setEtag("etag3123477") - * .build(); + * DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build(); * Policy response = policiesClient.deletePolicyAsync(request).get(); * } * } @@ -717,10 +680,7 @@ public final OperationFuture deletePolicyAsync( * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { * DeletePolicyRequest request = - * DeletePolicyRequest.newBuilder() - * .setName(PolicyName.of("[POLICY]").toString()) - * .setEtag("etag3123477") - * .build(); + * DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build(); * OperationFuture future = * policiesClient.deletePolicyOperationCallable().futureCall(request); * // Do something. @@ -744,10 +704,7 @@ public final OperationFuture deletePolicyAsync( * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { * DeletePolicyRequest request = - * DeletePolicyRequest.newBuilder() - * .setName(PolicyName.of("[POLICY]").toString()) - * .setEtag("etag3123477") - * .build(); + * DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build(); * ApiFuture future = policiesClient.deletePolicyCallable().futureCall(request); * // Do something. * Operation response = future.get(); diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java index 82677a3f..1f9de494 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java @@ -23,6 +23,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -141,11 +142,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return PoliciesStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return PoliciesStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return PoliciesStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return PoliciesStubSettings.defaultTransportChannelProvider(); } @@ -155,11 +163,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return PoliciesStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -197,6 +211,11 @@ private static Builder createDefault() { return new Builder(PoliciesStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(PoliciesStubSettings.newHttpJsonBuilder()); + } + public PoliciesStubSettings.Builder getStubSettingsBuilder() { return ((PoliciesStubSettings.Builder) getStubSettings()); } diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/gapic_metadata.json b/google-iam-policy/src/main/java/com/google/iam/v2beta/gapic_metadata.json index a68bf924..54136f10 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/gapic_metadata.json +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/gapic_metadata.json @@ -14,10 +14,10 @@ "methods": ["createPolicyAsync", "createPolicyAsync", "createPolicyOperationCallable", "createPolicyCallable"] }, "DeletePolicy": { - "methods": ["deletePolicyAsync", "deletePolicyAsync", "deletePolicyAsync", "deletePolicyOperationCallable", "deletePolicyCallable"] + "methods": ["deletePolicyAsync", "deletePolicyAsync", "deletePolicyOperationCallable", "deletePolicyCallable"] }, "GetPolicy": { - "methods": ["getPolicy", "getPolicy", "getPolicy", "getPolicyCallable"] + "methods": ["getPolicy", "getPolicy", "getPolicyCallable"] }, "ListPolicies": { "methods": ["listPolicies", "listPolicies", "listPoliciesPagedCallable", "listPoliciesCallable"] diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java index 1a342b28..f8f79438 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java @@ -29,7 +29,7 @@ * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (PoliciesClient policiesClient = PoliciesClient.create()) { - * PolicyName name = PolicyName.of("[POLICY]"); + * String name = "name3373707"; * Policy response = policiesClient.getPolicy(name); * } * } diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesCallableFactory.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesCallableFactory.java new file mode 100644 index 00000000..bc1cb4da --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Policies service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonPoliciesCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java new file mode 100644 index 00000000..1329c96f --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java @@ -0,0 +1,474 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2beta.stub; + +import static com.google.iam.v2beta.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.iam.v2beta.CreatePolicyRequest; +import com.google.iam.v2beta.DeletePolicyRequest; +import com.google.iam.v2beta.GetPolicyRequest; +import com.google.iam.v2beta.ListPoliciesRequest; +import com.google.iam.v2beta.ListPoliciesResponse; +import com.google.iam.v2beta.Policy; +import com.google.iam.v2beta.PolicyOperationMetadata; +import com.google.iam.v2beta.UpdatePolicyRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Policies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonPoliciesStub extends PoliciesStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Policy.getDescriptor()) + .add(PolicyOperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listPoliciesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2beta.Policies/ListPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=policies/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2beta.Policies/GetPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=policies/*/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2beta.Policies/CreatePolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=policies/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "policyId", request.getPolicyId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("policy", request.getPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreatePolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updatePolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2beta.Policies/UpdatePolicy") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{policy.name=policies/*/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "policy.name", request.getPolicy().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("policy", request.getPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdatePolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deletePolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2beta.Policies/DeletePolicy") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=policies/*/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeletePolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable listPoliciesCallable; + private final UnaryCallable + listPoliciesPagedCallable; + private final UnaryCallable getPolicyCallable; + private final UnaryCallable createPolicyCallable; + private final OperationCallable + createPolicyOperationCallable; + private final UnaryCallable updatePolicyCallable; + private final OperationCallable + updatePolicyOperationCallable; + private final UnaryCallable deletePolicyCallable; + private final OperationCallable + deletePolicyOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonPoliciesStub create(PoliciesStubSettings settings) + throws IOException { + return new HttpJsonPoliciesStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonPoliciesStub create(ClientContext clientContext) throws IOException { + return new HttpJsonPoliciesStub( + PoliciesStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonPoliciesStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonPoliciesStub( + PoliciesStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonPoliciesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonPoliciesStub(PoliciesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonPoliciesCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonPoliciesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonPoliciesStub( + PoliciesStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listPoliciesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updatePolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updatePolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deletePolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listPoliciesCallable = + callableFactory.createUnaryCallable( + listPoliciesTransportSettings, settings.listPoliciesSettings(), clientContext); + this.listPoliciesPagedCallable = + callableFactory.createPagedCallable( + listPoliciesTransportSettings, settings.listPoliciesSettings(), clientContext); + this.getPolicyCallable = + callableFactory.createUnaryCallable( + getPolicyTransportSettings, settings.getPolicySettings(), clientContext); + this.createPolicyCallable = + callableFactory.createUnaryCallable( + createPolicyTransportSettings, settings.createPolicySettings(), clientContext); + this.createPolicyOperationCallable = + callableFactory.createOperationCallable( + createPolicyTransportSettings, + settings.createPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updatePolicyCallable = + callableFactory.createUnaryCallable( + updatePolicyTransportSettings, settings.updatePolicySettings(), clientContext); + this.updatePolicyOperationCallable = + callableFactory.createOperationCallable( + updatePolicyTransportSettings, + settings.updatePolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deletePolicyCallable = + callableFactory.createUnaryCallable( + deletePolicyTransportSettings, settings.deletePolicySettings(), clientContext); + this.deletePolicyOperationCallable = + callableFactory.createOperationCallable( + deletePolicyTransportSettings, + settings.deletePolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listPoliciesMethodDescriptor); + methodDescriptors.add(getPolicyMethodDescriptor); + methodDescriptors.add(createPolicyMethodDescriptor); + methodDescriptors.add(updatePolicyMethodDescriptor); + methodDescriptors.add(deletePolicyMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listPoliciesCallable() { + return listPoliciesCallable; + } + + @Override + public UnaryCallable listPoliciesPagedCallable() { + return listPoliciesPagedCallable; + } + + @Override + public UnaryCallable getPolicyCallable() { + return getPolicyCallable; + } + + @Override + public UnaryCallable createPolicyCallable() { + return createPolicyCallable; + } + + @Override + public OperationCallable + createPolicyOperationCallable() { + return createPolicyOperationCallable; + } + + @Override + public UnaryCallable updatePolicyCallable() { + return updatePolicyCallable; + } + + @Override + public OperationCallable + updatePolicyOperationCallable() { + return updatePolicyOperationCallable; + } + + @Override + public UnaryCallable deletePolicyCallable() { + return deletePolicyCallable; + } + + @Override + public OperationCallable + deletePolicyOperationCallable() { + return deletePolicyOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStub.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStub.java index 9b6fcaff..540fa89d 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStub.java +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStub.java @@ -45,7 +45,11 @@ public abstract class PoliciesStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable listPoliciesPagedCallable() { diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java index ce17087d..48a3936f 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java @@ -28,6 +28,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -219,6 +222,11 @@ public PoliciesStub createStub() throws IOException { .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcPoliciesStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonPoliciesStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -251,29 +259,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + 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() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PoliciesStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PoliciesStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PoliciesStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -407,6 +440,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listPoliciesSettings() diff --git a/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientHttpJsonTest.java b/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientHttpJsonTest.java new file mode 100644 index 00000000..0c162380 --- /dev/null +++ b/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientHttpJsonTest.java @@ -0,0 +1,393 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2beta; + +import static com.google.iam.v2beta.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.iam.v2beta.stub.HttpJsonPoliciesStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class PoliciesClientHttpJsonTest { + private static MockHttpService mockService; + private static PoliciesClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonPoliciesStub.getMethodDescriptors(), PoliciesSettings.getDefaultEndpoint()); + PoliciesSettings settings = + PoliciesSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + PoliciesSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PoliciesClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listPoliciesTest() throws Exception { + Policy responsesElement = Policy.newBuilder().build(); + ListPoliciesResponse expectedResponse = + ListPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "policies/policie-1456/policie-1456"; + + ListPoliciesPagedResponse pagedListResponse = client.listPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "policies/policie-1456/policie-1456"; + client.listPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "policies/policie-3260/policie-3260/policie-3260"; + + Policy actualResponse = client.getPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "policies/policie-3260/policie-3260/policie-3260"; + client.getPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "policies/policie-1456/policie-1456"; + Policy policy = Policy.newBuilder().build(); + String policyId = "policyId546908653"; + + Policy actualResponse = client.createPolicyAsync(parent, policy, policyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "policies/policie-1456/policie-1456"; + Policy policy = Policy.newBuilder().build(); + String policyId = "policyId546908653"; + client.createPolicyAsync(parent, policy, policyId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updatePolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder() + .setPolicy( + Policy.newBuilder() + .setName("policies/policie-3260/policie-3260/policie-3260") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .build()) + .build(); + + Policy actualResponse = client.updatePolicyAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updatePolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder() + .setPolicy( + Policy.newBuilder() + .setName("policies/policie-3260/policie-3260/policie-3260") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .build()) + .build(); + client.updatePolicyAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deletePolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "policies/policie-3260/policie-3260/policie-3260"; + + Policy actualResponse = client.deletePolicyAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "policies/policie-3260/policie-3260/policie-3260"; + client.deletePolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientTest.java b/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientTest.java index 419e7677..ba966bb1 100644 --- a/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientTest.java +++ b/google-iam-policy/src/test/java/com/google/iam/v2beta/PoliciesClientTest.java @@ -133,54 +133,7 @@ public void listPoliciesExceptionTest() throws Exception { public void getPolicyTest() throws Exception { Policy expectedResponse = Policy.newBuilder() - .setName(PolicyName.of("[POLICY]").toString()) - .setUid("uid115792") - .setKind("kind3292052") - .setDisplayName("displayName1714148973") - .putAllAnnotations(new HashMap()) - .setEtag("etag3123477") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDeleteTime(Timestamp.newBuilder().build()) - .addAllRules(new ArrayList()) - .build(); - mockPolicies.addResponse(expectedResponse); - - PolicyName name = PolicyName.of("[POLICY]"); - - Policy actualResponse = client.getPolicy(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPolicies.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPolicyRequest actualRequest = ((GetPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicies.addException(exception); - - try { - PolicyName name = PolicyName.of("[POLICY]"); - client.getPolicy(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setName(PolicyName.of("[POLICY]").toString()) + .setName("name3373707") .setUid("uid115792") .setKind("kind3292052") .setDisplayName("displayName1714148973") @@ -210,7 +163,7 @@ public void getPolicyTest2() throws Exception { } @Test - public void getPolicyExceptionTest2() throws Exception { + public void getPolicyExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPolicies.addException(exception); @@ -227,7 +180,7 @@ public void getPolicyExceptionTest2() throws Exception { public void createPolicyTest() throws Exception { Policy expectedResponse = Policy.newBuilder() - .setName(PolicyName.of("[POLICY]").toString()) + .setName("name3373707") .setUid("uid115792") .setKind("kind3292052") .setDisplayName("displayName1714148973") @@ -288,7 +241,7 @@ public void createPolicyExceptionTest() throws Exception { public void updatePolicyTest() throws Exception { Policy expectedResponse = Policy.newBuilder() - .setName(PolicyName.of("[POLICY]").toString()) + .setName("name3373707") .setUid("uid115792") .setKind("kind3292052") .setDisplayName("displayName1714148973") @@ -345,62 +298,7 @@ public void updatePolicyExceptionTest() throws Exception { public void deletePolicyTest() throws Exception { Policy expectedResponse = Policy.newBuilder() - .setName(PolicyName.of("[POLICY]").toString()) - .setUid("uid115792") - .setKind("kind3292052") - .setDisplayName("displayName1714148973") - .putAllAnnotations(new HashMap()) - .setEtag("etag3123477") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setDeleteTime(Timestamp.newBuilder().build()) - .addAllRules(new ArrayList()) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deletePolicyTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockPolicies.addResponse(resultOperation); - - PolicyName name = PolicyName.of("[POLICY]"); - - Policy actualResponse = client.deletePolicyAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPolicies.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePolicyRequest actualRequest = ((DeletePolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicies.addException(exception); - - try { - PolicyName name = PolicyName.of("[POLICY]"); - client.deletePolicyAsync(name).get(); - 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()); - } - } - - @Test - public void deletePolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setName(PolicyName.of("[POLICY]").toString()) + .setName("name3373707") .setUid("uid115792") .setKind("kind3292052") .setDisplayName("displayName1714148973") @@ -436,7 +334,7 @@ public void deletePolicyTest2() throws Exception { } @Test - public void deletePolicyExceptionTest2() throws Exception { + public void deletePolicyExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPolicies.addException(exception); diff --git a/proto-google-iam-v2beta/pom.xml b/proto-google-iam-v2beta/pom.xml index 28a596c9..d2d43f45 100644 --- a/proto-google-iam-v2beta/pom.xml +++ b/proto-google-iam-v2beta/pom.xml @@ -21,14 +21,6 @@ com.google.api.grpc proto-google-common-protos - - com.google.api - api-common - - - com.google.guava - guava - diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java index a89ed24d..9899a5c3 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java @@ -136,9 +136,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -167,9 +165,7 @@ public java.lang.String getName() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -589,9 +585,7 @@ public Builder mergeFrom( * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -619,9 +613,7 @@ public java.lang.String getName() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -649,9 +641,7 @@ public com.google.protobuf.ByteString getNameBytes() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -678,9 +668,7 @@ public Builder setName(java.lang.String value) { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -703,9 +691,7 @@ public Builder clearName() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java index 265e0906..1b195298 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java @@ -36,9 +36,7 @@ public interface DeletePolicyRequestOrBuilder * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -56,9 +54,7 @@ public interface DeletePolicyRequestOrBuilder * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java index 45707bd1..d7af806b 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java @@ -185,7 +185,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -230,7 +230,7 @@ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -275,7 +275,7 @@ public int getDeniedPrincipalsCount() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -321,7 +321,7 @@ public java.lang.String getDeniedPrincipals(int index) { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1146,7 +1146,7 @@ private void ensureDeniedPrincipalsIsMutable() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1191,7 +1191,7 @@ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1236,7 +1236,7 @@ public int getDeniedPrincipalsCount() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1282,7 +1282,7 @@ public java.lang.String getDeniedPrincipals(int index) { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1328,7 +1328,7 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1381,7 +1381,7 @@ public Builder setDeniedPrincipals(int index, java.lang.String value) { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1433,7 +1433,7 @@ public Builder addDeniedPrincipals(java.lang.String value) { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1482,7 +1482,7 @@ public Builder addAllDeniedPrincipals(java.lang.Iterable value * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -1530,7 +1530,7 @@ public Builder clearDeniedPrincipals() { * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java index 1e318bc7..30258206 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java @@ -30,7 +30,7 @@ public interface DenyRuleOrBuilder * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -73,7 +73,7 @@ public interface DenyRuleOrBuilder * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -116,7 +116,7 @@ public interface DenyRuleOrBuilder * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For @@ -160,7 +160,7 @@ public interface DenyRuleOrBuilder * The identities that are prevented from using one or more permissions on * Google Cloud resources. This field can contain the following values: * * `principalSet://goog/public:all`: A special identifier that represents - * any user who is on the internet, even if they do not have a Google + * any principal that is on the internet, even if they do not have a Google * Account or are not logged in. * * `principal://goog/subject/{email_id}`: A specific Google Account. * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java index 9aa4e3a5..ef77af91 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java @@ -46,9 +46,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "eption_principals\030\002 \003(\t\022\032\n\022denied_permis" + "sions\030\003 \003(\t\022\035\n\025exception_permissions\030\004 \003" + "(\t\022+\n\020denial_condition\030\005 \001(\0132\021.google.ty" - + "pe.ExprB^\n\025com.google.iam.v2betaB\rDenyRu" - + "leProtoP\001Z4google.golang.org/genproto/go" - + "ogleapis/iam/v2beta;iamb\006proto3" + + "pe.ExprB\222\001\n\025com.google.iam.v2betaB\rDenyR" + + "uleProtoP\001Z4google.golang.org/genproto/g" + + "oogleapis/iam/v2beta;iam\252\002\027Google.Cloud." + + "Iam.V2Beta\312\002\027Google\\Cloud\\Iam\\V2betab\006pr" + + "oto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java index e082377e..2775a53c 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java @@ -128,9 +128,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -159,9 +157,7 @@ public java.lang.String getName() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -507,9 +503,7 @@ public Builder mergeFrom( * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -537,9 +531,7 @@ public java.lang.String getName() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -567,9 +559,7 @@ public com.google.protobuf.ByteString getNameBytes() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -596,9 +586,7 @@ public Builder setName(java.lang.String value) { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -621,9 +609,7 @@ public Builder clearName() { * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java index 483d9ef3..def78621 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java @@ -36,9 +36,7 @@ public interface GetPolicyRequestOrBuilder * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -56,9 +54,7 @@ public interface GetPolicyRequestOrBuilder * name. For projects, you can use the alphanumeric or the numeric ID. * * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyName.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyName.java deleted file mode 100644 index 15b7c14a..00000000 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.iam.v2beta; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class PolicyName implements ResourceName { - private static final PathTemplate POLICY = - PathTemplate.createWithoutUrlEncoding("policies/{policy}"); - private volatile Map fieldValuesMap; - private final String policy; - - @Deprecated - protected PolicyName() { - policy = null; - } - - private PolicyName(Builder builder) { - policy = Preconditions.checkNotNull(builder.getPolicy()); - } - - public String getPolicy() { - return policy; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static PolicyName of(String policy) { - return newBuilder().setPolicy(policy).build(); - } - - public static String format(String policy) { - return newBuilder().setPolicy(policy).build().toString(); - } - - public static PolicyName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - POLICY.validatedMatch( - formattedString, "PolicyName.parse: formattedString not in valid format"); - return of(matchMap.get("policy")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (PolicyName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return POLICY.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (policy != null) { - fieldMapBuilder.put("policy", policy); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return POLICY.instantiate("policy", policy); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - PolicyName that = ((PolicyName) o); - return Objects.equals(this.policy, that.policy); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(policy); - return h; - } - - /** Builder for policies/{policy}. */ - public static class Builder { - private String policy; - - protected Builder() {} - - public String getPolicy() { - return policy; - } - - public Builder setPolicy(String policy) { - this.policy = policy; - return this; - } - - private Builder(PolicyName policyName) { - this.policy = policyName.policy; - } - - public PolicyName build() { - return new PolicyName(this); - } - } -} diff --git a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java index de498bc2..fd7363e9 100644 --- a/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java +++ b/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java @@ -79,64 +79,62 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n\036google/iam/v2beta/policy.proto\022\021google" + ".iam.v2beta\032\034google/api/annotations.prot" + "o\032\027google/api/client.proto\032\037google/api/f" - + "ield_behavior.proto\032\031google/api/resource" - + ".proto\032\034google/iam/v2beta/deny.proto\032#go" - + "ogle/longrunning/operations.proto\032\037googl" - + "e/protobuf/timestamp.proto\"\334\003\n\006Policy\022\021\n" - + "\004name\030\001 \001(\tB\003\340A\005\022\020\n\003uid\030\002 \001(\tB\003\340A\005\022\021\n\004ki" - + "nd\030\003 \001(\tB\003\340A\003\022\024\n\014display_name\030\004 \001(\t\022?\n\013a" - + "nnotations\030\005 \003(\0132*.google.iam.v2beta.Pol" - + "icy.AnnotationsEntry\022\014\n\004etag\030\006 \001(\t\0224\n\013cr" - + "eate_time\030\007 \001(\0132\032.google.protobuf.Timest" - + "ampB\003\340A\003\0224\n\013update_time\030\010 \001(\0132\032.google.p" - + "rotobuf.TimestampB\003\340A\003\0224\n\013delete_time\030\t " - + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022,\n\005" - + "rules\030\n \003(\0132\035.google.iam.v2beta.PolicyRu" - + "le\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" - + "alue\030\002 \001(\t:\0028\001:1\352A.\n\031iam.googleapis.com/" - + "Policy\022\021policies/{policy}\"[\n\nPolicyRule\022" - + "0\n\tdeny_rule\030\002 \001(\0132\033.google.iam.v2beta.D" - + "enyRuleH\000\022\023\n\013description\030\001 \001(\tB\006\n\004kind\"Q" - + "\n\023ListPoliciesRequest\022\023\n\006parent\030\001 \001(\tB\003\340" - + "A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" - + "\t\"\\\n\024ListPoliciesResponse\022+\n\010policies\030\001 " - + "\003(\0132\031.google.iam.v2beta.Policy\022\027\n\017next_p" - + "age_token\030\002 \001(\t\"C\n\020GetPolicyRequest\022/\n\004n" - + "ame\030\001 \001(\tB!\340A\002\372A\033\n\031iam.googleapis.com/Po" - + "licy\"m\n\023CreatePolicyRequest\022\023\n\006parent\030\001 " - + "\001(\tB\003\340A\002\022.\n\006policy\030\002 \001(\0132\031.google.iam.v2" - + "beta.PolicyB\003\340A\002\022\021\n\tpolicy_id\030\003 \001(\t\"E\n\023U" - + "pdatePolicyRequest\022.\n\006policy\030\001 \001(\0132\031.goo" - + "gle.iam.v2beta.PolicyB\003\340A\002\"Y\n\023DeletePoli" - + "cyRequest\022/\n\004name\030\001 \001(\tB!\340A\002\372A\033\n\031iam.goo" - + "gleapis.com/Policy\022\021\n\004etag\030\002 \001(\tB\003\340A\001\"J\n" - + "\027PolicyOperationMetadata\022/\n\013create_time\030" - + "\001 \001(\0132\032.google.protobuf.Timestamp2\200\007\n\010Po" - + "licies\022\217\001\n\014ListPolicies\022&.google.iam.v2b" - + "eta.ListPoliciesRequest\032\'.google.iam.v2b" - + "eta.ListPoliciesResponse\".\202\323\344\223\002\037\022\035/v2bet" - + "a/{parent=policies/*/*}\332A\006parent\022y\n\tGetP" - + "olicy\022#.google.iam.v2beta.GetPolicyReque" - + "st\032\031.google.iam.v2beta.Policy\",\202\323\344\223\002\037\022\035/" - + "v2beta/{name=policies/*/*/*}\332A\004name\022\302\001\n\014" - + "CreatePolicy\022&.google.iam.v2beta.CreateP" - + "olicyRequest\032\035.google.longrunning.Operat" - + "ion\"k\202\323\344\223\002\'\"\035/v2beta/{parent=policies/*/" - + "*}:\006policy\332A\027parent,policy,policy_id\312A!\n" - + "\006Policy\022\027PolicyOperationMetadata\022\257\001\n\014Upd" - + "atePolicy\022&.google.iam.v2beta.UpdatePoli" + + "ield_behavior.proto\032\034google/iam/v2beta/d" + + "eny.proto\032#google/longrunning/operations" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\251\003\n\006Policy\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\020\n\003uid\030\002 \001" + + "(\tB\003\340A\005\022\021\n\004kind\030\003 \001(\tB\003\340A\003\022\024\n\014display_na" + + "me\030\004 \001(\t\022?\n\013annotations\030\005 \003(\0132*.google.i" + + "am.v2beta.Policy.AnnotationsEntry\022\014\n\004eta" + + "g\030\006 \001(\t\0224\n\013create_time\030\007 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0224\n\013update_time\030\010 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013d" + + "elete_time\030\t \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\022,\n\005rules\030\n \003(\0132\035.google.iam.v2" + + "beta.PolicyRule\0322\n\020AnnotationsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"[\n\nPolicyRul" + + "e\0220\n\tdeny_rule\030\002 \001(\0132\033.google.iam.v2beta" + + ".DenyRuleH\000\022\023\n\013description\030\001 \001(\tB\006\n\004kind" + + "\"Q\n\023ListPoliciesRequest\022\023\n\006parent\030\001 \001(\tB" + + "\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 " + + "\001(\t\"\\\n\024ListPoliciesResponse\022+\n\010policies\030" + + "\001 \003(\0132\031.google.iam.v2beta.Policy\022\027\n\017next" + + "_page_token\030\002 \001(\t\"%\n\020GetPolicyRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\"m\n\023CreatePolicyRequest\022" + + "\023\n\006parent\030\001 \001(\tB\003\340A\002\022.\n\006policy\030\002 \001(\0132\031.g" + + "oogle.iam.v2beta.PolicyB\003\340A\002\022\021\n\tpolicy_i" + + "d\030\003 \001(\t\"E\n\023UpdatePolicyRequest\022.\n\006policy" + + "\030\001 \001(\0132\031.google.iam.v2beta.PolicyB\003\340A\002\";" + + "\n\023DeletePolicyRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002" + + "\022\021\n\004etag\030\002 \001(\tB\003\340A\001\"J\n\027PolicyOperationMe" + + "tadata\022/\n\013create_time\030\001 \001(\0132\032.google.pro" + + "tobuf.Timestamp2\200\007\n\010Policies\022\217\001\n\014ListPol" + + "icies\022&.google.iam.v2beta.ListPoliciesRe" + + "quest\032\'.google.iam.v2beta.ListPoliciesRe" + + "sponse\".\202\323\344\223\002\037\022\035/v2beta/{parent=policies" + + "/*/*}\332A\006parent\022y\n\tGetPolicy\022#.google.iam" + + ".v2beta.GetPolicyRequest\032\031.google.iam.v2" + + "beta.Policy\",\202\323\344\223\002\037\022\035/v2beta/{name=polic" + + "ies/*/*/*}\332A\004name\022\302\001\n\014CreatePolicy\022&.goo" + + "gle.iam.v2beta.CreatePolicyRequest\032\035.goo" + + "gle.longrunning.Operation\"k\202\323\344\223\002\'\"\035/v2be" + + "ta/{parent=policies/*/*}:\006policy\332A\027paren" + + "t,policy,policy_id\312A!\n\006Policy\022\027PolicyOpe" + + "rationMetadata\022\257\001\n\014UpdatePolicy\022&.google" + + ".iam.v2beta.UpdatePolicyRequest\032\035.google" + + ".longrunning.Operation\"X\202\323\344\223\002.\032$/v2beta/" + + "{policy.name=policies/*/*/*}:\006policy\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\022\247\001\n\014Del" + + "etePolicy\022&.google.iam.v2beta.DeletePoli" + "cyRequest\032\035.google.longrunning.Operation" - + "\"X\202\323\344\223\002.\032$/v2beta/{policy.name=policies/" - + "*/*/*}:\006policy\312A!\n\006Policy\022\027PolicyOperati" - + "onMetadata\022\247\001\n\014DeletePolicy\022&.google.iam" - + ".v2beta.DeletePolicyRequest\032\035.google.lon" - + "grunning.Operation\"P\202\323\344\223\002\037*\035/v2beta/{nam" - + "e=policies/*/*/*}\332A\004name\312A!\n\006Policy\022\027Pol" - + "icyOperationMetadata\032F\312A\022iam.googleapis." - + "com\322A.https://www.googleapis.com/auth/cl" - + "oud-platformB\\\n\025com.google.iam.v2betaB\013P" - + "olicyProtoP\001Z4google.golang.org/genproto" - + "/googleapis/iam/v2beta;iamb\006proto3" + + "\"P\202\323\344\223\002\037*\035/v2beta/{name=policies/*/*/*}\332" + + "A\004name\312A!\n\006Policy\022\027PolicyOperationMetada" + + "ta\032F\312A\022iam.googleapis.com\322A.https://www." + + "googleapis.com/auth/cloud-platformB\220\001\n\025c" + + "om.google.iam.v2betaB\013PolicyProtoP\001Z4goo" + + "gle.golang.org/genproto/googleapis/iam/v" + + "2beta;iam\252\002\027Google.Cloud.Iam.V2Beta\312\002\027Go" + + "ogle\\Cloud\\Iam\\V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -145,7 +143,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), com.google.iam.v2beta.DenyRuleProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), @@ -245,15 +242,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.AnnotationsProto.http); registry.add(com.google.api.ClientProto.methodSignature); registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.api.ResourceProto.resource); - registry.add(com.google.api.ResourceProto.resourceReference); registry.add(com.google.longrunning.OperationsProto.operationInfo); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); com.google.iam.v2beta.DenyRuleProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto b/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto index 74444927..73ae7bbd 100644 --- a/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto +++ b/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto @@ -18,10 +18,12 @@ package google.iam.v2beta; import "google/type/expr.proto"; +option csharp_namespace = "Google.Cloud.Iam.V2Beta"; option go_package = "google.golang.org/genproto/googleapis/iam/v2beta;iam"; option java_multiple_files = true; option java_outer_classname = "DenyRuleProto"; option java_package = "com.google.iam.v2beta"; +option php_namespace = "Google\\Cloud\\Iam\\V2beta"; // A deny rule in an IAM deny policy. message DenyRule { @@ -29,7 +31,7 @@ message DenyRule { // Google Cloud resources. This field can contain the following values: // // * `principalSet://goog/public:all`: A special identifier that represents - // any user who is on the internet, even if they do not have a Google + // any principal that is on the internet, even if they do not have a Google // Account or are not logged in. // // * `principal://goog/subject/{email_id}`: A specific Google Account. diff --git a/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto b/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto index b3cba55e..99df3db0 100644 --- a/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto +++ b/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto @@ -19,15 +19,16 @@ package google.iam.v2beta; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; import "google/iam/v2beta/deny.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; +option csharp_namespace = "Google.Cloud.Iam.V2Beta"; option go_package = "google.golang.org/genproto/googleapis/iam/v2beta;iam"; option java_multiple_files = true; option java_outer_classname = "PolicyProto"; option java_package = "com.google.iam.v2beta"; +option php_namespace = "Google\\Cloud\\Iam\\V2beta"; // An interface for managing Identity and Access Management (IAM) policies. service Policies { @@ -104,11 +105,6 @@ service Policies { // Data for an IAM policy. message Policy { - option (google.api.resource) = { - type: "iam.googleapis.com/Policy" - pattern: "policies/{policy}" - }; - // Immutable. The resource name of the `Policy`, which must be unique. Format: // `policies/{attachment_point}/denypolicies/{policy_id}` // @@ -219,12 +215,7 @@ message GetPolicyRequest { // // For organizations and folders, use the numeric ID in the full resource // name. For projects, you can use the alphanumeric or the numeric ID. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "iam.googleapis.com/Policy" - } - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; } // Request message for `CreatePolicy`. @@ -274,12 +265,7 @@ message DeletePolicyRequest { // // For organizations and folders, use the numeric ID in the full resource // name. For projects, you can use the alphanumeric or the numeric ID. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "iam.googleapis.com/Policy" - } - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The expected `etag` of the policy to delete. If the value does not match // the value that is stored in IAM, the request fails with a `409` error code From f3b365df695b61515871c24dd2d14cde015ad599 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 31 Aug 2022 22:42:13 +0200 Subject: [PATCH 33/44] deps: update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220828-2.0.0 (#417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-cloudresourcemanager](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v3-rev20220807-2.0.0` -> `v3-rev20220828-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220828-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220828-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220828-2.0.0/compatibility-slim/v3-rev20220807-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-cloudresourcemanager/v3-rev20220828-2.0.0/confidence-slim/v3-rev20220807-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 90492bf7..5ca1435b 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -26,7 +26,7 @@ com.google.apis google-api-services-cloudresourcemanager - v3-rev20220807-2.0.0 + v3-rev20220828-2.0.0 com.google.auth From f9fe1fbf9610dd9d73f1f475efa74860627c8c11 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 31 Aug 2022 22:42:17 +0200 Subject: [PATCH 34/44] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.1 (#416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.0` -> `26.1.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/compatibility-slim/26.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/confidence-slim/26.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index 5ca1435b..b5e3c07e 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -72,7 +72,7 @@ com.google.cloud import pom - 26.1.0 + 26.1.1 From 3375ba3a5b44d97370233238a63e1a310b5b605a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Sep 2022 22:28:14 +0200 Subject: [PATCH 35/44] deps: update dependency com.google.auth:google-auth-library-oauth2-http to v1.11.0 (#419) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.auth:google-auth-library-oauth2-http](https://togithub.com/googleapis/google-auth-library-java) | `1.10.0` -> `1.11.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.11.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.11.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.11.0/compatibility-slim/1.10.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.auth:google-auth-library-oauth2-http/1.11.0/confidence-slim/1.10.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

googleapis/google-auth-library-java ### [`v1.11.0`](https://togithub.com/googleapis/google-auth-library-java/blob/HEAD/CHANGELOG.md#​1110-httpsgithubcomgoogleapisgoogle-auth-library-javacomparev1100v1110-2022-09-08) [Compare Source](https://togithub.com/googleapis/google-auth-library-java/compare/v1.10.0...v1.11.0) ##### Features - Adds configurable token lifetime support ([#​982](https://togithub.com/googleapis/google-auth-library-java/issues/982)) ([0198733](https://togithub.com/googleapis/google-auth-library-java/commit/0198733b9d294cbee95f1170f814fbfe94baa6fc)) ##### Bug Fixes - Add retries to public key fetch ([#​983](https://togithub.com/googleapis/google-auth-library-java/issues/983)) ([1200a39](https://togithub.com/googleapis/google-auth-library-java/commit/1200a39361e2a1767ef95306ba3ece1b749e82a8)) - Add Test to validate 0x20 in token ([#​971](https://togithub.com/googleapis/google-auth-library-java/issues/971)) ([612db0a](https://togithub.com/googleapis/google-auth-library-java/commit/612db0af3afa70b5400891ba3c7eab18ea5eb6bf)) - Change revoke request from get to post ([#​979](https://togithub.com/googleapis/google-auth-library-java/issues/979)) ([ead58b2](https://togithub.com/googleapis/google-auth-library-java/commit/ead58b22e04c00ece9f0ea55cbec20d2953f5460)) - Setting the retry count to default value and enabling ioexceptions to retry ([#​988](https://togithub.com/googleapis/google-auth-library-java/issues/988)) ([257071a](https://togithub.com/googleapis/google-auth-library-java/commit/257071aeb39c4441bd152813d727f83d433f346f)) - Updates IdTokenVerifier so that it does not cache a failed public key response ([#​967](https://togithub.com/googleapis/google-auth-library-java/issues/967)) ([1f4c9c7](https://togithub.com/googleapis/google-auth-library-java/commit/1f4c9c77a38fb6dfb751447361af9cf00964f96b))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index b5e3c07e..e2bab760 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -31,7 +31,7 @@ com.google.auth google-auth-library-oauth2-http - 1.10.0 + 1.11.0 com.google.http-client From e358921e5ade85359a97b6a19af7a8397227c428 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Sep 2022 23:02:21 +0200 Subject: [PATCH 36/44] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 (#420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.1` -> `3.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/compatibility-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/confidence-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​302-httpsgithubcomgoogleapisjava-shared-dependenciescomparev301v302-2022-09-08) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#​789](https://togithub.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://togithub.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab)) - Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#​781](https://togithub.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://togithub.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554)) - Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#​790](https://togithub.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://togithub.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92)) - Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#​773](https://togithub.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://togithub.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0)) - Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#​776](https://togithub.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://togithub.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#​780](https://togithub.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://togithub.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4)) - Update dependency io.grpc:grpc-bom to v1.48.1 ([#​768](https://togithub.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://togithub.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e)) - Update dependency io.grpc:grpc-bom to v1.49.0 ([#​786](https://togithub.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://togithub.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344)) - Update dependency org.checkerframework:checker-qual to v3.24.0 ([#​775](https://togithub.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://togithub.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b)) - Update dependency org.checkerframework:checker-qual to v3.25.0 ([#​788](https://togithub.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://togithub.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9)) - Update dependency org.threeten:threetenbp to v1.6.1 ([#​782](https://togithub.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://togithub.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9)) - Update gax.version to v2.19.0 ([#​785](https://togithub.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://togithub.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa)) - Update google.core.version to v2.8.10 ([#​787](https://togithub.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://togithub.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558)) - Update google.core.version to v2.8.7 ([#​774](https://togithub.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://togithub.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e)) - Update google.core.version to v2.8.8 ([#​777](https://togithub.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://togithub.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200)) - Update google.core.version to v2.8.9 ([#​784](https://togithub.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://togithub.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 25f33d80..9e9123a6 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.1 + 3.0.2 pom import From c12e226c5a3288c11e452b5a3c38f070504062ec Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 9 Sep 2022 14:42:18 +0000 Subject: [PATCH 37/44] chore(bazel): Update WORKSPACE files for rules_gapic, gax_java, generator_java versions (#418) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 472750037 Source-Link: https://github.com/googleapis/googleapis/commit/88f2ea3f53b9712f2e04f28f06210f6f77fa7e24 Source-Link: https://github.com/googleapis/googleapis-gen/commit/230a5588306aae18fe8f2a57f14d4039ad72c901 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjMwYTU1ODgzMDZhYWUxOGZlOGYyYTU3ZjE0ZDQwMzlhZDcyYzkwMSJ9 --- .../com/google/iam/v2beta/PoliciesClient.java | 154 +++++++++++++----- .../google/iam/v2beta/PoliciesSettings.java | 12 +- .../com/google/iam/v2beta/package-info.java | 7 +- .../iam/v2beta/stub/HttpJsonPoliciesStub.java | 6 +- .../iam/v2beta/stub/PoliciesStubSettings.java | 12 +- 5 files changed, 131 insertions(+), 60 deletions(-) diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java index 8cc89dce..495c60c0 100644 --- a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java +++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesClient.java @@ -45,8 +45,11 @@ * calls that map to API methods. Sample code to get started: * *
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (PoliciesClient policiesClient = PoliciesClient.create()) {
  *   String name = "name3373707";
  *   Policy response = policiesClient.getPolicy(name);
@@ -82,8 +85,11 @@
  * 

To customize credentials: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * PoliciesSettings policiesSettings =
  *     PoliciesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -94,8 +100,11 @@
  * 

To customize the endpoint: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * PoliciesSettings policiesSettings =
  *     PoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
  * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings);
@@ -105,8 +114,11 @@
  * the wire:
  *
  * 
{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * PoliciesSettings policiesSettings =
  *     PoliciesSettings.newBuilder()
  *         .setTransportChannelProvider(
@@ -200,8 +212,11 @@ public final OperationsClient getHttpJsonOperationsClient() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String parent = "parent-995424086";
    *   for (Policy element : policiesClient.listPolicies(parent).iterateAll()) {
@@ -233,8 +248,11 @@ public final ListPoliciesPagedResponse listPolicies(String parent) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   ListPoliciesRequest request =
    *       ListPoliciesRequest.newBuilder()
@@ -264,8 +282,11 @@ public final ListPoliciesPagedResponse listPolicies(ListPoliciesRequest request)
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   ListPoliciesRequest request =
    *       ListPoliciesRequest.newBuilder()
@@ -295,8 +316,11 @@ public final ListPoliciesPagedResponse listPolicies(ListPoliciesRequest request)
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   ListPoliciesRequest request =
    *       ListPoliciesRequest.newBuilder()
@@ -330,8 +354,11 @@ public final UnaryCallable listPolici
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String name = "name3373707";
    *   Policy response = policiesClient.getPolicy(name);
@@ -359,8 +386,11 @@ public final Policy getPolicy(String name) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build();
    *   Policy response = policiesClient.getPolicy(request);
@@ -381,8 +411,11 @@ public final Policy getPolicy(GetPolicyRequest request) {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build();
    *   ApiFuture future = policiesClient.getPolicyCallable().futureCall(request);
@@ -402,8 +435,11 @@ public final UnaryCallable getPolicyCallable() {
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String parent = "parent-995424086";
    *   Policy policy = Policy.newBuilder().build();
@@ -444,8 +480,11 @@ public final OperationFuture createPolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   CreatePolicyRequest request =
    *       CreatePolicyRequest.newBuilder()
@@ -472,8 +511,11 @@ public final OperationFuture createPolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   CreatePolicyRequest request =
    *       CreatePolicyRequest.newBuilder()
@@ -500,8 +542,11 @@ public final OperationFuture createPolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   CreatePolicyRequest request =
    *       CreatePolicyRequest.newBuilder()
@@ -535,8 +580,11 @@ public final UnaryCallable createPolicyCallable(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   UpdatePolicyRequest request =
    *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
@@ -568,8 +616,11 @@ public final OperationFuture updatePolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   UpdatePolicyRequest request =
    *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
@@ -601,8 +652,11 @@ public final OperationFuture updatePolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   UpdatePolicyRequest request =
    *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
@@ -623,8 +677,11 @@ public final UnaryCallable updatePolicyCallable(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   String name = "name3373707";
    *   Policy response = policiesClient.deletePolicyAsync(name).get();
@@ -652,8 +709,11 @@ public final OperationFuture deletePolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   DeletePolicyRequest request =
    *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
@@ -676,8 +736,11 @@ public final OperationFuture deletePolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   DeletePolicyRequest request =
    *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
@@ -700,8 +763,11 @@ public final OperationFuture deletePolicyAsync(
    * 

Sample code: * *

{@code
-   * // This snippet has been automatically generated for illustrative purposes only.
-   * // It may require modifications to work in your environment.
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (PoliciesClient policiesClient = PoliciesClient.create()) {
    *   DeletePolicyRequest request =
    *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java
index 1f9de494..de80d3ce 100644
--- a/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java
+++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/PoliciesSettings.java
@@ -55,16 +55,16 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * PoliciesSettings.Builder policiesSettingsBuilder = PoliciesSettings.newBuilder();
  * policiesSettingsBuilder
  *     .getPolicySettings()
  *     .setRetrySettings(
- *         policiesSettingsBuilder
- *             .getPolicySettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         policiesSettingsBuilder.getPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PoliciesSettings policiesSettings = policiesSettingsBuilder.build();
diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java
index f8f79438..e5ed7054 100644
--- a/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java
+++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/package-info.java
@@ -26,8 +26,11 @@
  * 

Sample for PoliciesClient: * *

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * try (PoliciesClient policiesClient = PoliciesClient.create()) {
  *   String name = "name3373707";
  *   Policy response = policiesClient.getPolicy(name);
diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java
index 1329c96f..cd12ad29 100644
--- a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java
+++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/HttpJsonPoliciesStub.java
@@ -160,7 +160,8 @@ public class HttpJsonPoliciesStub extends PoliciesStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("policy", request.getPolicy()))
+                              ProtoRestSerializer.create()
+                                  .toBody("policy", request.getPolicy(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
@@ -199,7 +200,8 @@ public class HttpJsonPoliciesStub extends PoliciesStub {
                           })
                       .setRequestBodyExtractor(
                           request ->
-                              ProtoRestSerializer.create().toBody("policy", request.getPolicy()))
+                              ProtoRestSerializer.create()
+                                  .toBody("policy", request.getPolicy(), false))
                       .build())
               .setResponseParser(
                   ProtoMessageResponseParser.newBuilder()
diff --git a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java
index 48a3936f..7bfcfdf5 100644
--- a/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java
+++ b/google-iam-policy/src/main/java/com/google/iam/v2beta/stub/PoliciesStubSettings.java
@@ -83,16 +83,16 @@
  * 

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

{@code
- * // This snippet has been automatically generated for illustrative purposes only.
- * // It may require modifications to work in your environment.
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
  * PoliciesStubSettings.Builder policiesSettingsBuilder = PoliciesStubSettings.newBuilder();
  * policiesSettingsBuilder
  *     .getPolicySettings()
  *     .setRetrySettings(
- *         policiesSettingsBuilder
- *             .getPolicySettings()
- *             .getRetrySettings()
- *             .toBuilder()
+ *         policiesSettingsBuilder.getPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PoliciesStubSettings policiesSettings = policiesSettingsBuilder.build();

From ee3b570322355450a6ff636dc9f4df3209740400 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Sat, 10 Sep 2022 02:24:11 +0000
Subject: [PATCH 38/44] chore: Generated snippets should not be owned by
 samples reviewers (#1575) (#421)

Source-Link: https://github.com/googleapis/synthtool/commit/2e9ac19d5b8181af77cdc5337cf922517813cc49
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
---
 .github/.OwlBot.lock.yaml | 3 +--
 .github/CODEOWNERS        | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index de9173d9..62592923 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,5 +13,4 @@
 # limitations under the License.
 docker:
   image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
-  digest: sha256:d4b80feffe1579818cdc39466152e9de95789a193408506cd4a1ffbe8804dc00
-# created: 2022-07-13T13:53:17.676447481Z
+  digest: sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 30fdb7b9..db2d8ad1 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -8,3 +8,6 @@
 
 # The java-samples-reviewers team is the default owner for samples changes
 samples/**/*.java       @googleapis/java-samples-reviewers
+
+# Generated snippets should not be owned by samples reviewers
+samples/snippets/generated/       @googleapis/yoshi-java

From 6b6c24f11093d2ccc5e5005337576db7c9626ec0 Mon Sep 17 00:00:00 2001
From: Mike Eltsufin 
Date: Tue, 13 Sep 2022 22:28:39 -0400
Subject: [PATCH 39/44] feat: add v2 client (#423)

The commit are broken down to make it clear which parts are autogenerated and which parts had to be manually edited.
---
 .github/.OwlBot.yaml                          |   36 +-
 google-iam-policy/pom.xml                     |    9 +
 .../com/google/iam/v2/PoliciesClient.java     | 1136 ++++++
 .../com/google/iam/v2/PoliciesSettings.java   |  303 ++
 .../com/google/iam/v2/gapic_metadata.json     |   36 +
 .../java/com/google/iam/v2/package-info.java  |   43 +
 .../v2/stub/GrpcPoliciesCallableFactory.java  |  113 +
 .../google/iam/v2/stub/GrpcPoliciesStub.java  |  384 ++
 .../stub/HttpJsonPoliciesCallableFactory.java |  105 +
 .../iam/v2/stub/HttpJsonPoliciesStub.java     |  552 +++
 .../com/google/iam/v2/stub/PoliciesStub.java  |  108 +
 .../iam/v2/stub/PoliciesStubSettings.java     |  738 ++++
 .../java/com/google/iam/v2/MockPolicies.java  |   59 +
 .../com/google/iam/v2/MockPoliciesImpl.java   |  187 +
 .../iam/v2/PoliciesClientHttpJsonTest.java    |  451 +++
 .../com/google/iam/v2/PoliciesClientTest.java |  402 ++
 grpc-google-iam-v2/pom.xml                    |   69 +
 .../java/com/google/iam/v2/PoliciesGrpc.java  |  971 +++++
 pom.xml                                       |   12 +
 .../clirr-ignored-differences.xml             |   19 +
 proto-google-iam-v2/pom.xml                   |   34 +
 .../google/iam/v2/CreatePolicyRequest.java    | 1148 ++++++
 .../iam/v2/CreatePolicyRequestOrBuilder.java  |  130 +
 .../google/iam/v2/DeletePolicyRequest.java    |  883 +++++
 .../iam/v2/DeletePolicyRequestOrBuilder.java  |   95 +
 .../main/java/com/google/iam/v2/DenyRule.java | 2504 ++++++++++++
 .../com/google/iam/v2/DenyRuleOrBuilder.java  |  468 +++
 .../java/com/google/iam/v2/DenyRuleProto.java |   75 +
 .../com/google/iam/v2/GetPolicyRequest.java   |  674 ++++
 .../iam/v2/GetPolicyRequestOrBuilder.java     |   62 +
 .../iam/v2/ListApplicablePoliciesRequest.java | 1207 ++++++
 ...istApplicablePoliciesRequestOrBuilder.java |  141 +
 .../v2/ListApplicablePoliciesResponse.java    | 1503 ++++++++
 ...stApplicablePoliciesResponseOrBuilder.java |  180 +
 .../google/iam/v2/ListPoliciesRequest.java    |  970 +++++
 .../iam/v2/ListPoliciesRequestOrBuilder.java  |  107 +
 .../google/iam/v2/ListPoliciesResponse.java   | 1132 ++++++
 .../iam/v2/ListPoliciesResponseOrBuilder.java |  105 +
 .../main/java/com/google/iam/v2/Policy.java   | 3369 +++++++++++++++++
 .../iam/v2/PolicyOperationMetadata.java       |  728 ++++
 .../v2/PolicyOperationMetadataOrBuilder.java  |   60 +
 .../com/google/iam/v2/PolicyOrBuilder.java    |  444 +++
 .../java/com/google/iam/v2/PolicyProto.java   |  290 ++
 .../java/com/google/iam/v2/PolicyRule.java    | 1007 +++++
 .../google/iam/v2/PolicyRuleOrBuilder.java    |   89 +
 .../google/iam/v2/UpdatePolicyRequest.java    |  755 ++++
 .../iam/v2/UpdatePolicyRequestOrBuilder.java  |   69 +
 .../src/main/proto/google/iam/v2/deny.proto   |  109 +
 .../src/main/proto/google/iam/v2/policy.proto |  376 ++
 versions.txt                                  |    2 +
 50 files changed, 24434 insertions(+), 15 deletions(-)
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/package-info.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesCallableFactory.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesCallableFactory.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java
 create mode 100644 google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java
 create mode 100644 google-iam-policy/src/test/java/com/google/iam/v2/MockPolicies.java
 create mode 100644 google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java
 create mode 100644 google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java
 create mode 100644 google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java
 create mode 100644 grpc-google-iam-v2/pom.xml
 create mode 100644 grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java
 create mode 100644 proto-google-iam-v2/clirr-ignored-differences.xml
 create mode 100644 proto-google-iam-v2/pom.xml
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java
 create mode 100644 proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java
 create mode 100644 proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto
 create mode 100644 proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto

diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml
index b7d331d4..5df4166a 100644
--- a/.github/.OwlBot.yaml
+++ b/.github/.OwlBot.yaml
@@ -16,22 +16,28 @@ docker:
   image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest"
 
 deep-remove-regex:
-- "/grpc-google-.*/src"
-- "/proto-google-.*/src"
+  - "/grpc-google-.*/src"
+  - "/proto-google-.*/src"
 
 deep-preserve-regex:
-- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
-- "/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging"
-- "/proto-google-iam-v1/src/main/proto/google/iam/v1"
+  - "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
+  - "/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging"
+  - "/proto-google-iam-v1/src/main/proto/google/iam/v1"
 
 deep-copy-regex:
-- source: "/google/iam/v1/google-iam-v1-java/grpc-google-iam-v1-java/src"
-  dest: "/owl-bot-staging/v1/grpc-google-iam-v1/src"
-- source: "/google/iam/v1/google-iam-v1-java/proto-google-iam-v1-java/src"
-  dest: "/owl-bot-staging/v1/proto-google-iam-v1/src"
-- source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/grpc-google-cloud-iam-v2beta-java/src"
-  dest: "/owl-bot-staging/v2beta/grpc-google-iam-v2beta/src"
-- source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/proto-google-cloud-iam-v2beta-java/src"
-  dest: "/owl-bot-staging/v2beta/proto-google-iam-v2beta/src"
-- source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/gapic-google-cloud-iam-v2beta-java/src"
-  dest: "/owl-bot-staging/v2beta/google-iam-policy/src"
\ No newline at end of file
+  - source: "/google/iam/v1/google-iam-v1-java/grpc-google-iam-v1-java/src"
+    dest: "/owl-bot-staging/v1/grpc-google-iam-v1/src"
+  - source: "/google/iam/v1/google-iam-v1-java/proto-google-iam-v1-java/src"
+    dest: "/owl-bot-staging/v1/proto-google-iam-v1/src"
+  - source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/grpc-google-cloud-iam-v2beta-java/src"
+    dest: "/owl-bot-staging/v2beta/grpc-google-iam-v2beta/src"
+  - source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/proto-google-cloud-iam-v2beta-java/src"
+    dest: "/owl-bot-staging/v2beta/proto-google-iam-v2beta/src"
+  - source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/gapic-google-cloud-iam-v2beta-java/src"
+    dest: "/owl-bot-staging/v2beta/google-iam-policy/src"
+  - source: "/google/iam/v2/google-cloud-iam-v2-java/grpc-google-cloud-iam-v2-java/src"
+    dest: "/owl-bot-staging/v2/grpc-google-iam-v2/src"
+  - source: "/google/iam/v2/google-cloud-iam-v2-java/proto-google-cloud-iam-v2-java/src"
+    dest: "/owl-bot-staging/v2/proto-google-iam-v2/src"
+  - source: "/google/iam/v2/google-cloud-iam-v2-java/gapic-google-cloud-iam-v2-java/src"
+    dest: "/owl-bot-staging/v2/google-iam-policy/src"
\ No newline at end of file
diff --git a/google-iam-policy/pom.xml b/google-iam-policy/pom.xml
index d720bd06..7b320083 100644
--- a/google-iam-policy/pom.xml
+++ b/google-iam-policy/pom.xml
@@ -46,6 +46,10 @@
       com.google.api.grpc
       proto-google-iam-v2beta
     
+    
+      com.google.api.grpc
+      proto-google-iam-v2
+    
     
       com.google.guava
       guava
@@ -80,6 +84,11 @@
       grpc-google-iam-v2beta
       test
     
+    
+      com.google.api.grpc
+      grpc-google-iam-v2
+      test
+    
     
     
       com.google.api
diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java b/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java
new file mode 100644
index 00000000..b7e40fcd
--- /dev/null
+++ b/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java
@@ -0,0 +1,1136 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.iam.v2;
+
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.iam.v2.stub.PoliciesStub;
+import com.google.iam.v2.stub.PoliciesStubSettings;
+import com.google.longrunning.Operation;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: An interface for managing Identity and Access Management (IAM) policies.
+ *
+ * 

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: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+ *   String name = "name3373707";
+ *   Policy response = policiesClient.getPolicy(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the PoliciesClient 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 + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of PoliciesSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PoliciesSettings policiesSettings =
+ *     PoliciesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PoliciesSettings policiesSettings =
+ *     PoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PoliciesSettings policiesSettings =
+ *     PoliciesSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             PoliciesSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * PoliciesClient policiesClient = PoliciesClient.create(policiesSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class PoliciesClient implements BackgroundResource { + private final PoliciesSettings settings; + private final PoliciesStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of PoliciesClient with default settings. */ + public static final PoliciesClient create() throws IOException { + return create(PoliciesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of PoliciesClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final PoliciesClient create(PoliciesSettings settings) throws IOException { + return new PoliciesClient(settings); + } + + /** + * Constructs an instance of PoliciesClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(PoliciesSettings). + */ + public static final PoliciesClient create(PoliciesStub stub) { + return new PoliciesClient(stub); + } + + /** + * Constructs an instance of PoliciesClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected PoliciesClient(PoliciesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((PoliciesStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected PoliciesClient(PoliciesStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final PoliciesSettings getSettings() { + return settings; + } + + public PoliciesStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the policies of the specified kind that are attached to a resource. + * + *

The response lists only policy metadata. In particular, policy rules are omitted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   String parent = "parent-995424086";
+   *   for (Policy element : policiesClient.listPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource that the policy is attached to, along with the kind of + * policy to list. Format: `policies/{attachment_point}/denypolicies` + *

The attachment point is identified by its URL-encoded full resource name, which means + * that the forward-slash character, `/`, must be written as `%2F`. For example, + * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + *

For organizations and folders, use the numeric ID in the full resource name. For + * projects, you can use the alphanumeric or the numeric ID. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPoliciesPagedResponse listPolicies(String parent) { + ListPoliciesRequest request = ListPoliciesRequest.newBuilder().setParent(parent).build(); + return listPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the policies of the specified kind that are attached to a resource. + * + *

The response lists only policy metadata. In particular, policy rules are omitted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   ListPoliciesRequest request =
+   *       ListPoliciesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Policy element : policiesClient.listPolicies(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 + */ + public final ListPoliciesPagedResponse listPolicies(ListPoliciesRequest request) { + return listPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the policies of the specified kind that are attached to a resource. + * + *

The response lists only policy metadata. In particular, policy rules are omitted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   ListPoliciesRequest request =
+   *       ListPoliciesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = policiesClient.listPoliciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Policy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPoliciesPagedCallable() { + return stub.listPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the policies of the specified kind that are attached to a resource. + * + *

The response lists only policy metadata. In particular, policy rules are omitted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   ListPoliciesRequest request =
+   *       ListPoliciesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListPoliciesResponse response = policiesClient.listPoliciesCallable().call(request);
+   *     for (Policy element : response.getPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listPoliciesCallable() { + return stub.listPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   String name = "name3373707";
+   *   Policy response = policiesClient.getPolicy(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the policy to retrieve. Format: + * `policies/{attachment_point}/denypolicies/{policy_id}` + *

Use the URL-encoded full resource name, which means that the forward-slash character, + * `/`, must be written as `%2F`. For example, + * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + *

For organizations and folders, use the numeric ID in the full resource name. For + * projects, you can use the alphanumeric or the numeric ID. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getPolicy(String name) { + GetPolicyRequest request = GetPolicyRequest.newBuilder().setName(name).build(); + return getPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build();
+   *   Policy response = policiesClient.getPolicy(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 Policy getPolicy(GetPolicyRequest request) { + return getPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   GetPolicyRequest request = GetPolicyRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = policiesClient.getPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPolicyCallable() { + return stub.getPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   String parent = "parent-995424086";
+   *   Policy policy = Policy.newBuilder().build();
+   *   String policyId = "policyId546908653";
+   *   Policy response = policiesClient.createPolicyAsync(parent, policy, policyId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource that the policy is attached to, along with the kind of + * policy to create. Format: `policies/{attachment_point}/denypolicies` + *

The attachment point is identified by its URL-encoded full resource name, which means + * that the forward-slash character, `/`, must be written as `%2F`. For example, + * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + *

For organizations and folders, use the numeric ID in the full resource name. For + * projects, you can use the alphanumeric or the numeric ID. + * @param policy Required. The policy to create. + * @param policyId The ID to use for this policy, which will become the final component of the + * policy's resource name. The ID must contain 3 to 63 characters. It can contain lowercase + * letters and numbers, as well as dashes (`-`) and periods (`.`). The first character must be + * a lowercase letter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createPolicyAsync( + String parent, Policy policy, String policyId) { + CreatePolicyRequest request = + CreatePolicyRequest.newBuilder() + .setParent(parent) + .setPolicy(policy) + .setPolicyId(policyId) + .build(); + return createPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   CreatePolicyRequest request =
+   *       CreatePolicyRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setPolicyId("policyId546908653")
+   *           .build();
+   *   Policy response = policiesClient.createPolicyAsync(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 + */ + public final OperationFuture createPolicyAsync( + CreatePolicyRequest request) { + return createPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   CreatePolicyRequest request =
+   *       CreatePolicyRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setPolicyId("policyId546908653")
+   *           .build();
+   *   OperationFuture future =
+   *       policiesClient.createPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createPolicyOperationCallable() { + return stub.createPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a policy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   CreatePolicyRequest request =
+   *       CreatePolicyRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setPolicyId("policyId546908653")
+   *           .build();
+   *   ApiFuture future = policiesClient.createPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createPolicyCallable() { + return stub.createPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the specified policy. + * + *

You can update only the rules and the display name for the policy. + * + *

To update a policy, you should use a read-modify-write loop: + * + *

1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the + * policy. 2. Modify the policy as needed. 3. Use `UpdatePolicy` to write the updated policy. + * + *

This pattern helps prevent conflicts between concurrent updates. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   UpdatePolicyRequest request =
+   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
+   *   Policy response = policiesClient.updatePolicyAsync(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 + */ + public final OperationFuture updatePolicyAsync( + UpdatePolicyRequest request) { + return updatePolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the specified policy. + * + *

You can update only the rules and the display name for the policy. + * + *

To update a policy, you should use a read-modify-write loop: + * + *

1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the + * policy. 2. Modify the policy as needed. 3. Use `UpdatePolicy` to write the updated policy. + * + *

This pattern helps prevent conflicts between concurrent updates. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   UpdatePolicyRequest request =
+   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
+   *   OperationFuture future =
+   *       policiesClient.updatePolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updatePolicyOperationCallable() { + return stub.updatePolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the specified policy. + * + *

You can update only the rules and the display name for the policy. + * + *

To update a policy, you should use a read-modify-write loop: + * + *

1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the + * policy. 2. Modify the policy as needed. 3. Use `UpdatePolicy` to write the updated policy. + * + *

This pattern helps prevent conflicts between concurrent updates. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   UpdatePolicyRequest request =
+   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
+   *   ApiFuture future = policiesClient.updatePolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updatePolicyCallable() { + return stub.updatePolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a policy. This action is permanent. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   String name = "name3373707";
+   *   Policy response = policiesClient.deletePolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the policy to delete. Format: + * `policies/{attachment_point}/denypolicies/{policy_id}` + *

Use the URL-encoded full resource name, which means that the forward-slash character, + * `/`, must be written as `%2F`. For example, + * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + *

For organizations and folders, use the numeric ID in the full resource name. For + * projects, you can use the alphanumeric or the numeric ID. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deletePolicyAsync(String name) { + DeletePolicyRequest request = DeletePolicyRequest.newBuilder().setName(name).build(); + return deletePolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a policy. This action is permanent. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   DeletePolicyRequest request =
+   *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
+   *   Policy response = policiesClient.deletePolicyAsync(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 + */ + public final OperationFuture deletePolicyAsync( + DeletePolicyRequest request) { + return deletePolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a policy. This action is permanent. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   DeletePolicyRequest request =
+   *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
+   *   OperationFuture future =
+   *       policiesClient.deletePolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deletePolicyOperationCallable() { + return stub.deletePolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a policy. This action is permanent. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   DeletePolicyRequest request =
+   *       DeletePolicyRequest.newBuilder().setName("name3373707").setEtag("etag3123477").build();
+   *   ApiFuture future = policiesClient.deletePolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deletePolicyCallable() { + return stub.deletePolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves all the policies that are attached to the specified resource, or anywhere in the + * ancestry of the resource. For example, for a project this endpoint would return all the + * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent + * organization (if any). The endpoint requires the same permissions that it would take to call + * `ListPolicies` or `GetPolicy`. + * + *

The main reason to use this endpoint is as a policy admin to debug access issues for a + * resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   String attachmentPoint = "attachmentPoint-686994899";
+   *   for (Policy element : policiesClient.listApplicablePolicies(attachmentPoint).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param attachmentPoint Required. The Cloud resource at which the applicable policies are to be + * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource name, which means + * that the forward-slash character, `/`, must be written as `%2F`. For example, + * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListApplicablePoliciesPagedResponse listApplicablePolicies(String attachmentPoint) { + ListApplicablePoliciesRequest request = + ListApplicablePoliciesRequest.newBuilder().setAttachmentPoint(attachmentPoint).build(); + return listApplicablePolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves all the policies that are attached to the specified resource, or anywhere in the + * ancestry of the resource. For example, for a project this endpoint would return all the + * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent + * organization (if any). The endpoint requires the same permissions that it would take to call + * `ListPolicies` or `GetPolicy`. + * + *

The main reason to use this endpoint is as a policy admin to debug access issues for a + * resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   ListApplicablePoliciesRequest request =
+   *       ListApplicablePoliciesRequest.newBuilder()
+   *           .setAttachmentPoint("attachmentPoint-686994899")
+   *           .setFilter("filter-1274492040")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (Policy element : policiesClient.listApplicablePolicies(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 + */ + public final ListApplicablePoliciesPagedResponse listApplicablePolicies( + ListApplicablePoliciesRequest request) { + return listApplicablePoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves all the policies that are attached to the specified resource, or anywhere in the + * ancestry of the resource. For example, for a project this endpoint would return all the + * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent + * organization (if any). The endpoint requires the same permissions that it would take to call + * `ListPolicies` or `GetPolicy`. + * + *

The main reason to use this endpoint is as a policy admin to debug access issues for a + * resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   ListApplicablePoliciesRequest request =
+   *       ListApplicablePoliciesRequest.newBuilder()
+   *           .setAttachmentPoint("attachmentPoint-686994899")
+   *           .setFilter("filter-1274492040")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future =
+   *       policiesClient.listApplicablePoliciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Policy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listApplicablePoliciesPagedCallable() { + return stub.listApplicablePoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves all the policies that are attached to the specified resource, or anywhere in the + * ancestry of the resource. For example, for a project this endpoint would return all the + * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent + * organization (if any). The endpoint requires the same permissions that it would take to call + * `ListPolicies` or `GetPolicy`. + * + *

The main reason to use this endpoint is as a policy admin to debug access issues for a + * resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+   *   ListApplicablePoliciesRequest request =
+   *       ListApplicablePoliciesRequest.newBuilder()
+   *           .setAttachmentPoint("attachmentPoint-686994899")
+   *           .setFilter("filter-1274492040")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListApplicablePoliciesResponse response =
+   *         policiesClient.listApplicablePoliciesCallable().call(request);
+   *     for (Policy element : response.getPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listApplicablePoliciesCallable() { + return stub.listApplicablePoliciesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListPoliciesPagedResponse + extends AbstractPagedListResponse< + ListPoliciesRequest, + ListPoliciesResponse, + Policy, + ListPoliciesPage, + ListPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPoliciesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPoliciesPagedResponse(ListPoliciesPage page) { + super(page, ListPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPoliciesPage + extends AbstractPage { + + private ListPoliciesPage( + PageContext context, + ListPoliciesResponse response) { + super(context, response); + } + + private static ListPoliciesPage createEmptyPage() { + return new ListPoliciesPage(null, null); + } + + @Override + protected ListPoliciesPage createPage( + PageContext context, + ListPoliciesResponse response) { + return new ListPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPoliciesRequest, + ListPoliciesResponse, + Policy, + ListPoliciesPage, + ListPoliciesFixedSizeCollection> { + + private ListPoliciesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPoliciesFixedSizeCollection createEmptyCollection() { + return new ListPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPoliciesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListApplicablePoliciesPagedResponse + extends AbstractPagedListResponse< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + Policy, + ListApplicablePoliciesPage, + ListApplicablePoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListApplicablePoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListApplicablePoliciesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListApplicablePoliciesPagedResponse(ListApplicablePoliciesPage page) { + super(page, ListApplicablePoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListApplicablePoliciesPage + extends AbstractPage< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + Policy, + ListApplicablePoliciesPage> { + + private ListApplicablePoliciesPage( + PageContext context, + ListApplicablePoliciesResponse response) { + super(context, response); + } + + private static ListApplicablePoliciesPage createEmptyPage() { + return new ListApplicablePoliciesPage(null, null); + } + + @Override + protected ListApplicablePoliciesPage createPage( + PageContext context, + ListApplicablePoliciesResponse response) { + return new ListApplicablePoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListApplicablePoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + Policy, + ListApplicablePoliciesPage, + ListApplicablePoliciesFixedSizeCollection> { + + private ListApplicablePoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListApplicablePoliciesFixedSizeCollection createEmptyCollection() { + return new ListApplicablePoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListApplicablePoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListApplicablePoliciesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java b/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java new file mode 100644 index 00000000..a8e27342 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java @@ -0,0 +1,303 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.iam.v2.stub.PoliciesStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link PoliciesClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (iam.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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 getPolicy to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PoliciesSettings.Builder policiesSettingsBuilder = PoliciesSettings.newBuilder();
+ * policiesSettingsBuilder
+ *     .getPolicySettings()
+ *     .setRetrySettings(
+ *         policiesSettingsBuilder.getPolicySettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PoliciesSettings policiesSettings = policiesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class PoliciesSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listPolicies. */ + public PagedCallSettings + listPoliciesSettings() { + return ((PoliciesStubSettings) getStubSettings()).listPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to getPolicy. */ + public UnaryCallSettings getPolicySettings() { + return ((PoliciesStubSettings) getStubSettings()).getPolicySettings(); + } + + /** Returns the object with the settings used for calls to createPolicy. */ + public UnaryCallSettings createPolicySettings() { + return ((PoliciesStubSettings) getStubSettings()).createPolicySettings(); + } + + /** Returns the object with the settings used for calls to createPolicy. */ + public OperationCallSettings + createPolicyOperationSettings() { + return ((PoliciesStubSettings) getStubSettings()).createPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updatePolicy. */ + public UnaryCallSettings updatePolicySettings() { + return ((PoliciesStubSettings) getStubSettings()).updatePolicySettings(); + } + + /** Returns the object with the settings used for calls to updatePolicy. */ + public OperationCallSettings + updatePolicyOperationSettings() { + return ((PoliciesStubSettings) getStubSettings()).updatePolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deletePolicy. */ + public UnaryCallSettings deletePolicySettings() { + return ((PoliciesStubSettings) getStubSettings()).deletePolicySettings(); + } + + /** Returns the object with the settings used for calls to deletePolicy. */ + public OperationCallSettings + deletePolicyOperationSettings() { + return ((PoliciesStubSettings) getStubSettings()).deletePolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to listApplicablePolicies. */ + public PagedCallSettings< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + listApplicablePoliciesSettings() { + return ((PoliciesStubSettings) getStubSettings()).listApplicablePoliciesSettings(); + } + + public static final PoliciesSettings create(PoliciesStubSettings stub) throws IOException { + return new PoliciesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PoliciesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PoliciesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PoliciesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PoliciesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PoliciesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return PoliciesStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PoliciesStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PoliciesStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 PoliciesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PoliciesSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(PoliciesStubSettings.newBuilder(clientContext)); + } + + protected Builder(PoliciesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PoliciesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(PoliciesStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(PoliciesStubSettings.newHttpJsonBuilder()); + } + + public PoliciesStubSettings.Builder getStubSettingsBuilder() { + return ((PoliciesStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listPolicies. */ + public PagedCallSettings.Builder< + ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse> + listPoliciesSettings() { + return getStubSettingsBuilder().listPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to getPolicy. */ + public UnaryCallSettings.Builder getPolicySettings() { + return getStubSettingsBuilder().getPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createPolicy. */ + public UnaryCallSettings.Builder createPolicySettings() { + return getStubSettingsBuilder().createPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createPolicy. */ + public OperationCallSettings.Builder + createPolicyOperationSettings() { + return getStubSettingsBuilder().createPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updatePolicy. */ + public UnaryCallSettings.Builder updatePolicySettings() { + return getStubSettingsBuilder().updatePolicySettings(); + } + + /** Returns the builder for the settings used for calls to updatePolicy. */ + public OperationCallSettings.Builder + updatePolicyOperationSettings() { + return getStubSettingsBuilder().updatePolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deletePolicy. */ + public UnaryCallSettings.Builder deletePolicySettings() { + return getStubSettingsBuilder().deletePolicySettings(); + } + + /** Returns the builder for the settings used for calls to deletePolicy. */ + public OperationCallSettings.Builder + deletePolicyOperationSettings() { + return getStubSettingsBuilder().deletePolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listApplicablePolicies. */ + public PagedCallSettings.Builder< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + listApplicablePoliciesSettings() { + return getStubSettingsBuilder().listApplicablePoliciesSettings(); + } + + @Override + public PoliciesSettings build() throws IOException { + return new PoliciesSettings(this); + } + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json b/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json new file mode 100644 index 00000000..c0965438 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.iam.v2", + "libraryPackage": "com.google.iam.v2", + "services": { + "Policies": { + "clients": { + "grpc": { + "libraryClient": "PoliciesClient", + "rpcs": { + "CreatePolicy": { + "methods": ["createPolicyAsync", "createPolicyAsync", "createPolicyOperationCallable", "createPolicyCallable"] + }, + "DeletePolicy": { + "methods": ["deletePolicyAsync", "deletePolicyAsync", "deletePolicyOperationCallable", "deletePolicyCallable"] + }, + "GetPolicy": { + "methods": ["getPolicy", "getPolicy", "getPolicyCallable"] + }, + "ListApplicablePolicies": { + "methods": ["listApplicablePolicies", "listApplicablePolicies", "listApplicablePoliciesPagedCallable", "listApplicablePoliciesCallable"] + }, + "ListPolicies": { + "methods": ["listPolicies", "listPolicies", "listPoliciesPagedCallable", "listPoliciesCallable"] + }, + "UpdatePolicy": { + "methods": ["updatePolicyAsync", "updatePolicyOperationCallable", "updatePolicyCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/package-info.java b/google-iam-policy/src/main/java/com/google/iam/v2/package-info.java new file mode 100644 index 00000000..1994b92c --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Identity and Access Management (IAM) API + * + *

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

======================= PoliciesClient ======================= + * + *

Service Description: An interface for managing Identity and Access Management (IAM) policies. + * + *

Sample for PoliciesClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PoliciesClient policiesClient = PoliciesClient.create()) {
+ *   String name = "name3373707";
+ *   Policy response = policiesClient.getPolicy(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.iam.v2; + +import javax.annotation.Generated; diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesCallableFactory.java b/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesCallableFactory.java new file mode 100644 index 00000000..a09e6477 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +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. +/** + * gRPC callable factory implementation for the Policies service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcPoliciesCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java b/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java new file mode 100644 index 00000000..3a0f0620 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java @@ -0,0 +1,384 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2.stub; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v2.CreatePolicyRequest; +import com.google.iam.v2.DeletePolicyRequest; +import com.google.iam.v2.GetPolicyRequest; +import com.google.iam.v2.ListApplicablePoliciesRequest; +import com.google.iam.v2.ListApplicablePoliciesResponse; +import com.google.iam.v2.ListPoliciesRequest; +import com.google.iam.v2.ListPoliciesResponse; +import com.google.iam.v2.Policy; +import com.google.iam.v2.PolicyOperationMetadata; +import com.google.iam.v2.UpdatePolicyRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Policies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcPoliciesStub extends PoliciesStub { + private static final MethodDescriptor + listPoliciesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v2.Policies/ListPolicies") + .setRequestMarshaller(ProtoUtils.marshaller(ListPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPoliciesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v2.Policies/GetPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v2.Policies/CreatePolicy") + .setRequestMarshaller(ProtoUtils.marshaller(CreatePolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updatePolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v2.Policies/UpdatePolicy") + .setRequestMarshaller(ProtoUtils.marshaller(UpdatePolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deletePolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v2.Policies/DeletePolicy") + .setRequestMarshaller(ProtoUtils.marshaller(DeletePolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListApplicablePoliciesRequest, ListApplicablePoliciesResponse> + listApplicablePoliciesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v2.Policies/ListApplicablePolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListApplicablePoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListApplicablePoliciesResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable listPoliciesCallable; + private final UnaryCallable + listPoliciesPagedCallable; + private final UnaryCallable getPolicyCallable; + private final UnaryCallable createPolicyCallable; + private final OperationCallable + createPolicyOperationCallable; + private final UnaryCallable updatePolicyCallable; + private final OperationCallable + updatePolicyOperationCallable; + private final UnaryCallable deletePolicyCallable; + private final OperationCallable + deletePolicyOperationCallable; + private final UnaryCallable + listApplicablePoliciesCallable; + private final UnaryCallable + listApplicablePoliciesPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPoliciesStub create(PoliciesStubSettings settings) throws IOException { + return new GrpcPoliciesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPoliciesStub create(ClientContext clientContext) throws IOException { + return new GrpcPoliciesStub(PoliciesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPoliciesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPoliciesStub( + PoliciesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPoliciesStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcPoliciesStub(PoliciesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcPoliciesCallableFactory()); + } + + /** + * Constructs an instance of GrpcPoliciesStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcPoliciesStub( + PoliciesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listPoliciesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPoliciesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updatePolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("policy.name", String.valueOf(request.getPolicy().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deletePolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listApplicablePoliciesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listApplicablePoliciesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("attachment_point", String.valueOf(request.getAttachmentPoint())); + return params.build(); + }) + .build(); + + this.listPoliciesCallable = + callableFactory.createUnaryCallable( + listPoliciesTransportSettings, settings.listPoliciesSettings(), clientContext); + this.listPoliciesPagedCallable = + callableFactory.createPagedCallable( + listPoliciesTransportSettings, settings.listPoliciesSettings(), clientContext); + this.getPolicyCallable = + callableFactory.createUnaryCallable( + getPolicyTransportSettings, settings.getPolicySettings(), clientContext); + this.createPolicyCallable = + callableFactory.createUnaryCallable( + createPolicyTransportSettings, settings.createPolicySettings(), clientContext); + this.createPolicyOperationCallable = + callableFactory.createOperationCallable( + createPolicyTransportSettings, + settings.createPolicyOperationSettings(), + clientContext, + operationsStub); + this.updatePolicyCallable = + callableFactory.createUnaryCallable( + updatePolicyTransportSettings, settings.updatePolicySettings(), clientContext); + this.updatePolicyOperationCallable = + callableFactory.createOperationCallable( + updatePolicyTransportSettings, + settings.updatePolicyOperationSettings(), + clientContext, + operationsStub); + this.deletePolicyCallable = + callableFactory.createUnaryCallable( + deletePolicyTransportSettings, settings.deletePolicySettings(), clientContext); + this.deletePolicyOperationCallable = + callableFactory.createOperationCallable( + deletePolicyTransportSettings, + settings.deletePolicyOperationSettings(), + clientContext, + operationsStub); + this.listApplicablePoliciesCallable = + callableFactory.createUnaryCallable( + listApplicablePoliciesTransportSettings, + settings.listApplicablePoliciesSettings(), + clientContext); + this.listApplicablePoliciesPagedCallable = + callableFactory.createPagedCallable( + listApplicablePoliciesTransportSettings, + settings.listApplicablePoliciesSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listPoliciesCallable() { + return listPoliciesCallable; + } + + @Override + public UnaryCallable listPoliciesPagedCallable() { + return listPoliciesPagedCallable; + } + + @Override + public UnaryCallable getPolicyCallable() { + return getPolicyCallable; + } + + @Override + public UnaryCallable createPolicyCallable() { + return createPolicyCallable; + } + + @Override + public OperationCallable + createPolicyOperationCallable() { + return createPolicyOperationCallable; + } + + @Override + public UnaryCallable updatePolicyCallable() { + return updatePolicyCallable; + } + + @Override + public OperationCallable + updatePolicyOperationCallable() { + return updatePolicyOperationCallable; + } + + @Override + public UnaryCallable deletePolicyCallable() { + return deletePolicyCallable; + } + + @Override + public OperationCallable + deletePolicyOperationCallable() { + return deletePolicyOperationCallable; + } + + @Override + public UnaryCallable + listApplicablePoliciesCallable() { + return listApplicablePoliciesCallable; + } + + @Override + public UnaryCallable + listApplicablePoliciesPagedCallable() { + return listApplicablePoliciesPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesCallableFactory.java b/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesCallableFactory.java new file mode 100644 index 00000000..27bd9b72 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Policies service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonPoliciesCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java b/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java new file mode 100644 index 00000000..6370f750 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java @@ -0,0 +1,552 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2.stub; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.iam.v2.CreatePolicyRequest; +import com.google.iam.v2.DeletePolicyRequest; +import com.google.iam.v2.GetPolicyRequest; +import com.google.iam.v2.ListApplicablePoliciesRequest; +import com.google.iam.v2.ListApplicablePoliciesResponse; +import com.google.iam.v2.ListPoliciesRequest; +import com.google.iam.v2.ListPoliciesResponse; +import com.google.iam.v2.Policy; +import com.google.iam.v2.PolicyOperationMetadata; +import com.google.iam.v2.UpdatePolicyRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Policies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonPoliciesStub extends PoliciesStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(PolicyOperationMetadata.getDescriptor()) + .add(Policy.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listPoliciesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2.Policies/ListPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=policies/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2.Policies/GetPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=policies/*/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2.Policies/CreatePolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=policies/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "policyId", request.getPolicyId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("policy", request.getPolicy(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreatePolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updatePolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2.Policies/UpdatePolicy") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{policy.name=policies/*/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "policy.name", request.getPolicy().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("policy", request.getPolicy(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdatePolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deletePolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v2.Policies/DeletePolicy") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=policies/*/*/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeletePolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListApplicablePoliciesRequest, ListApplicablePoliciesResponse> + listApplicablePoliciesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.iam.v2.Policies/ListApplicablePolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{attachmentPoint=*}:listApplicablePolicies", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "attachmentPoint", request.getAttachmentPoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListApplicablePoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listPoliciesCallable; + private final UnaryCallable + listPoliciesPagedCallable; + private final UnaryCallable getPolicyCallable; + private final UnaryCallable createPolicyCallable; + private final OperationCallable + createPolicyOperationCallable; + private final UnaryCallable updatePolicyCallable; + private final OperationCallable + updatePolicyOperationCallable; + private final UnaryCallable deletePolicyCallable; + private final OperationCallable + deletePolicyOperationCallable; + private final UnaryCallable + listApplicablePoliciesCallable; + private final UnaryCallable + listApplicablePoliciesPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonPoliciesStub create(PoliciesStubSettings settings) + throws IOException { + return new HttpJsonPoliciesStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonPoliciesStub create(ClientContext clientContext) throws IOException { + return new HttpJsonPoliciesStub( + PoliciesStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonPoliciesStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonPoliciesStub( + PoliciesStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonPoliciesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonPoliciesStub(PoliciesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonPoliciesCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonPoliciesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonPoliciesStub( + PoliciesStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listPoliciesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updatePolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updatePolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deletePolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listApplicablePoliciesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listApplicablePoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listPoliciesCallable = + callableFactory.createUnaryCallable( + listPoliciesTransportSettings, settings.listPoliciesSettings(), clientContext); + this.listPoliciesPagedCallable = + callableFactory.createPagedCallable( + listPoliciesTransportSettings, settings.listPoliciesSettings(), clientContext); + this.getPolicyCallable = + callableFactory.createUnaryCallable( + getPolicyTransportSettings, settings.getPolicySettings(), clientContext); + this.createPolicyCallable = + callableFactory.createUnaryCallable( + createPolicyTransportSettings, settings.createPolicySettings(), clientContext); + this.createPolicyOperationCallable = + callableFactory.createOperationCallable( + createPolicyTransportSettings, + settings.createPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updatePolicyCallable = + callableFactory.createUnaryCallable( + updatePolicyTransportSettings, settings.updatePolicySettings(), clientContext); + this.updatePolicyOperationCallable = + callableFactory.createOperationCallable( + updatePolicyTransportSettings, + settings.updatePolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deletePolicyCallable = + callableFactory.createUnaryCallable( + deletePolicyTransportSettings, settings.deletePolicySettings(), clientContext); + this.deletePolicyOperationCallable = + callableFactory.createOperationCallable( + deletePolicyTransportSettings, + settings.deletePolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listApplicablePoliciesCallable = + callableFactory.createUnaryCallable( + listApplicablePoliciesTransportSettings, + settings.listApplicablePoliciesSettings(), + clientContext); + this.listApplicablePoliciesPagedCallable = + callableFactory.createPagedCallable( + listApplicablePoliciesTransportSettings, + settings.listApplicablePoliciesSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listPoliciesMethodDescriptor); + methodDescriptors.add(getPolicyMethodDescriptor); + methodDescriptors.add(createPolicyMethodDescriptor); + methodDescriptors.add(updatePolicyMethodDescriptor); + methodDescriptors.add(deletePolicyMethodDescriptor); + methodDescriptors.add(listApplicablePoliciesMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listPoliciesCallable() { + return listPoliciesCallable; + } + + @Override + public UnaryCallable listPoliciesPagedCallable() { + return listPoliciesPagedCallable; + } + + @Override + public UnaryCallable getPolicyCallable() { + return getPolicyCallable; + } + + @Override + public UnaryCallable createPolicyCallable() { + return createPolicyCallable; + } + + @Override + public OperationCallable + createPolicyOperationCallable() { + return createPolicyOperationCallable; + } + + @Override + public UnaryCallable updatePolicyCallable() { + return updatePolicyCallable; + } + + @Override + public OperationCallable + updatePolicyOperationCallable() { + return updatePolicyOperationCallable; + } + + @Override + public UnaryCallable deletePolicyCallable() { + return deletePolicyCallable; + } + + @Override + public OperationCallable + deletePolicyOperationCallable() { + return deletePolicyOperationCallable; + } + + @Override + public UnaryCallable + listApplicablePoliciesCallable() { + return listApplicablePoliciesCallable; + } + + @Override + public UnaryCallable + listApplicablePoliciesPagedCallable() { + return listApplicablePoliciesPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java b/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java new file mode 100644 index 00000000..f00f4af8 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java @@ -0,0 +1,108 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2.stub; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.iam.v2.CreatePolicyRequest; +import com.google.iam.v2.DeletePolicyRequest; +import com.google.iam.v2.GetPolicyRequest; +import com.google.iam.v2.ListApplicablePoliciesRequest; +import com.google.iam.v2.ListApplicablePoliciesResponse; +import com.google.iam.v2.ListPoliciesRequest; +import com.google.iam.v2.ListPoliciesResponse; +import com.google.iam.v2.Policy; +import com.google.iam.v2.PolicyOperationMetadata; +import com.google.iam.v2.UpdatePolicyRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Policies service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class PoliciesStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable listPoliciesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPoliciesPagedCallable()"); + } + + public UnaryCallable listPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listPoliciesCallable()"); + } + + public UnaryCallable getPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getPolicyCallable()"); + } + + public OperationCallable + createPolicyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createPolicyOperationCallable()"); + } + + public UnaryCallable createPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: createPolicyCallable()"); + } + + public OperationCallable + updatePolicyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updatePolicyOperationCallable()"); + } + + public UnaryCallable updatePolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updatePolicyCallable()"); + } + + public OperationCallable + deletePolicyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deletePolicyOperationCallable()"); + } + + public UnaryCallable deletePolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deletePolicyCallable()"); + } + + public UnaryCallable + listApplicablePoliciesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listApplicablePoliciesPagedCallable()"); + } + + public UnaryCallable + listApplicablePoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listApplicablePoliciesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java b/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java new file mode 100644 index 00000000..3a7ffe92 --- /dev/null +++ b/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java @@ -0,0 +1,738 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2.stub; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v2.CreatePolicyRequest; +import com.google.iam.v2.DeletePolicyRequest; +import com.google.iam.v2.GetPolicyRequest; +import com.google.iam.v2.ListApplicablePoliciesRequest; +import com.google.iam.v2.ListApplicablePoliciesResponse; +import com.google.iam.v2.ListPoliciesRequest; +import com.google.iam.v2.ListPoliciesResponse; +import com.google.iam.v2.Policy; +import com.google.iam.v2.PolicyOperationMetadata; +import com.google.iam.v2.UpdatePolicyRequest; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link PoliciesStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (iam.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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 getPolicy to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PoliciesStubSettings.Builder policiesSettingsBuilder = PoliciesStubSettings.newBuilder();
+ * policiesSettingsBuilder
+ *     .getPolicySettings()
+ *     .setRetrySettings(
+ *         policiesSettingsBuilder.getPolicySettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PoliciesStubSettings policiesSettings = policiesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class PoliciesStubSettings 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 PagedCallSettings< + ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse> + listPoliciesSettings; + private final UnaryCallSettings getPolicySettings; + private final UnaryCallSettings createPolicySettings; + private final OperationCallSettings + createPolicyOperationSettings; + private final UnaryCallSettings updatePolicySettings; + private final OperationCallSettings + updatePolicyOperationSettings; + private final UnaryCallSettings deletePolicySettings; + private final OperationCallSettings + deletePolicyOperationSettings; + private final PagedCallSettings< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + listApplicablePoliciesSettings; + + private static final PagedListDescriptor + LIST_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPoliciesRequest injectToken(ListPoliciesRequest payload, String token) { + return ListPoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPoliciesRequest injectPageSize(ListPoliciesRequest payload, int pageSize) { + return ListPoliciesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPoliciesResponse payload) { + return payload.getPoliciesList() == null + ? ImmutableList.of() + : payload.getPoliciesList(); + } + }; + + private static final PagedListDescriptor< + ListApplicablePoliciesRequest, ListApplicablePoliciesResponse, Policy> + LIST_APPLICABLE_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListApplicablePoliciesRequest, ListApplicablePoliciesResponse, Policy>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListApplicablePoliciesRequest injectToken( + ListApplicablePoliciesRequest payload, String token) { + return ListApplicablePoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListApplicablePoliciesRequest injectPageSize( + ListApplicablePoliciesRequest payload, int pageSize) { + return ListApplicablePoliciesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListApplicablePoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListApplicablePoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListApplicablePoliciesResponse payload) { + return payload.getPoliciesList() == null + ? ImmutableList.of() + : payload.getPoliciesList(); + } + }; + + private static final PagedListResponseFactory< + ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse> + LIST_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_POLICIES_PAGE_STR_DESC, request, context); + return ListPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + LIST_APPLICABLE_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListApplicablePoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_APPLICABLE_POLICIES_PAGE_STR_DESC, request, context); + return ListApplicablePoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listPolicies. */ + public PagedCallSettings + listPoliciesSettings() { + return listPoliciesSettings; + } + + /** Returns the object with the settings used for calls to getPolicy. */ + public UnaryCallSettings getPolicySettings() { + return getPolicySettings; + } + + /** Returns the object with the settings used for calls to createPolicy. */ + public UnaryCallSettings createPolicySettings() { + return createPolicySettings; + } + + /** Returns the object with the settings used for calls to createPolicy. */ + public OperationCallSettings + createPolicyOperationSettings() { + return createPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to updatePolicy. */ + public UnaryCallSettings updatePolicySettings() { + return updatePolicySettings; + } + + /** Returns the object with the settings used for calls to updatePolicy. */ + public OperationCallSettings + updatePolicyOperationSettings() { + return updatePolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to deletePolicy. */ + public UnaryCallSettings deletePolicySettings() { + return deletePolicySettings; + } + + /** Returns the object with the settings used for calls to deletePolicy. */ + public OperationCallSettings + deletePolicyOperationSettings() { + return deletePolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to listApplicablePolicies. */ + public PagedCallSettings< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + listApplicablePoliciesSettings() { + return listApplicablePoliciesSettings; + } + + public PoliciesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPoliciesStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonPoliciesStub.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 "iam.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "iam.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + 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 defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PoliciesStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PoliciesStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PoliciesStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 PoliciesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listPoliciesSettings = settingsBuilder.listPoliciesSettings().build(); + getPolicySettings = settingsBuilder.getPolicySettings().build(); + createPolicySettings = settingsBuilder.createPolicySettings().build(); + createPolicyOperationSettings = settingsBuilder.createPolicyOperationSettings().build(); + updatePolicySettings = settingsBuilder.updatePolicySettings().build(); + updatePolicyOperationSettings = settingsBuilder.updatePolicyOperationSettings().build(); + deletePolicySettings = settingsBuilder.deletePolicySettings().build(); + deletePolicyOperationSettings = settingsBuilder.deletePolicyOperationSettings().build(); + listApplicablePoliciesSettings = settingsBuilder.listApplicablePoliciesSettings().build(); + } + + /** Builder for PoliciesStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse> + listPoliciesSettings; + private final UnaryCallSettings.Builder getPolicySettings; + private final UnaryCallSettings.Builder createPolicySettings; + private final OperationCallSettings.Builder< + CreatePolicyRequest, Policy, PolicyOperationMetadata> + createPolicyOperationSettings; + private final UnaryCallSettings.Builder updatePolicySettings; + private final OperationCallSettings.Builder< + UpdatePolicyRequest, Policy, PolicyOperationMetadata> + updatePolicyOperationSettings; + private final UnaryCallSettings.Builder deletePolicySettings; + private final OperationCallSettings.Builder< + DeletePolicyRequest, Policy, PolicyOperationMetadata> + deletePolicyOperationSettings; + private final PagedCallSettings.Builder< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + listApplicablePoliciesSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listPoliciesSettings = PagedCallSettings.newBuilder(LIST_POLICIES_PAGE_STR_FACT); + getPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createPolicyOperationSettings = OperationCallSettings.newBuilder(); + updatePolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updatePolicyOperationSettings = OperationCallSettings.newBuilder(); + deletePolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePolicyOperationSettings = OperationCallSettings.newBuilder(); + listApplicablePoliciesSettings = + PagedCallSettings.newBuilder(LIST_APPLICABLE_POLICIES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listPoliciesSettings, + getPolicySettings, + createPolicySettings, + updatePolicySettings, + deletePolicySettings, + listApplicablePoliciesSettings); + initDefaults(this); + } + + protected Builder(PoliciesStubSettings settings) { + super(settings); + + listPoliciesSettings = settings.listPoliciesSettings.toBuilder(); + getPolicySettings = settings.getPolicySettings.toBuilder(); + createPolicySettings = settings.createPolicySettings.toBuilder(); + createPolicyOperationSettings = settings.createPolicyOperationSettings.toBuilder(); + updatePolicySettings = settings.updatePolicySettings.toBuilder(); + updatePolicyOperationSettings = settings.updatePolicyOperationSettings.toBuilder(); + deletePolicySettings = settings.deletePolicySettings.toBuilder(); + deletePolicyOperationSettings = settings.deletePolicyOperationSettings.toBuilder(); + listApplicablePoliciesSettings = settings.listApplicablePoliciesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listPoliciesSettings, + getPolicySettings, + createPolicySettings, + updatePolicySettings, + deletePolicySettings, + listApplicablePoliciesSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updatePolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deletePolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listApplicablePoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Policy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PolicyOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updatePolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Policy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PolicyOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deletePolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Policy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PolicyOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listPolicies. */ + public PagedCallSettings.Builder< + ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse> + listPoliciesSettings() { + return listPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to getPolicy. */ + public UnaryCallSettings.Builder getPolicySettings() { + return getPolicySettings; + } + + /** Returns the builder for the settings used for calls to createPolicy. */ + public UnaryCallSettings.Builder createPolicySettings() { + return createPolicySettings; + } + + /** Returns the builder for the settings used for calls to createPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createPolicyOperationSettings() { + return createPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updatePolicy. */ + public UnaryCallSettings.Builder updatePolicySettings() { + return updatePolicySettings; + } + + /** Returns the builder for the settings used for calls to updatePolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updatePolicyOperationSettings() { + return updatePolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deletePolicy. */ + public UnaryCallSettings.Builder deletePolicySettings() { + return deletePolicySettings; + } + + /** Returns the builder for the settings used for calls to deletePolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deletePolicyOperationSettings() { + return deletePolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to listApplicablePolicies. */ + public PagedCallSettings.Builder< + ListApplicablePoliciesRequest, + ListApplicablePoliciesResponse, + ListApplicablePoliciesPagedResponse> + listApplicablePoliciesSettings() { + return listApplicablePoliciesSettings; + } + + @Override + public PoliciesStubSettings build() throws IOException { + return new PoliciesStubSettings(this); + } + } +} diff --git a/google-iam-policy/src/test/java/com/google/iam/v2/MockPolicies.java b/google-iam-policy/src/test/java/com/google/iam/v2/MockPolicies.java new file mode 100644 index 00000000..52054775 --- /dev/null +++ b/google-iam-policy/src/test/java/com/google/iam/v2/MockPolicies.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPolicies implements MockGrpcService { + private final MockPoliciesImpl serviceImpl; + + public MockPolicies() { + serviceImpl = new MockPoliciesImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java b/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java new file mode 100644 index 00000000..1abaf30f --- /dev/null +++ b/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java @@ -0,0 +1,187 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2; + +import com.google.api.core.BetaApi; +import com.google.iam.v2.PoliciesGrpc.PoliciesImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPoliciesImpl extends PoliciesImplBase { + private List requests; + private Queue responses; + + public MockPoliciesImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listPolicies( + ListPoliciesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPoliciesResponse) { + requests.add(request); + responseObserver.onNext(((ListPoliciesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListPolicies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPoliciesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPolicy(GetPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createPolicy( + CreatePolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreatePolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updatePolicy( + UpdatePolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdatePolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePolicy( + DeletePolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeletePolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listApplicablePolicies( + ListApplicablePoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListApplicablePoliciesResponse) { + requests.add(request); + responseObserver.onNext(((ListApplicablePoliciesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListApplicablePolicies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListApplicablePoliciesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java b/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java new file mode 100644 index 00000000..e6534c85 --- /dev/null +++ b/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java @@ -0,0 +1,451 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.iam.v2.stub.HttpJsonPoliciesStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class PoliciesClientHttpJsonTest { + private static MockHttpService mockService; + private static PoliciesClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonPoliciesStub.getMethodDescriptors(), PoliciesSettings.getDefaultEndpoint()); + PoliciesSettings settings = + PoliciesSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + PoliciesSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PoliciesClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listPoliciesTest() throws Exception { + Policy responsesElement = Policy.newBuilder().build(); + ListPoliciesResponse expectedResponse = + ListPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "policies/policie-1456/policie-1456"; + + ListPoliciesPagedResponse pagedListResponse = client.listPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "policies/policie-1456/policie-1456"; + client.listPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + mockService.addResponse(expectedResponse); + + String name = "policies/policie-3260/policie-3260/policie-3260"; + + Policy actualResponse = client.getPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "policies/policie-3260/policie-3260/policie-3260"; + client.getPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "policies/policie-1456/policie-1456"; + Policy policy = Policy.newBuilder().build(); + String policyId = "policyId546908653"; + + Policy actualResponse = client.createPolicyAsync(parent, policy, policyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "policies/policie-1456/policie-1456"; + Policy policy = Policy.newBuilder().build(); + String policyId = "policyId546908653"; + client.createPolicyAsync(parent, policy, policyId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updatePolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder() + .setPolicy( + Policy.newBuilder() + .setName("policies/policie-3260/policie-3260/policie-3260") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build()) + .build(); + + Policy actualResponse = client.updatePolicyAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updatePolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder() + .setPolicy( + Policy.newBuilder() + .setName("policies/policie-3260/policie-3260/policie-3260") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build()) + .build(); + client.updatePolicyAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deletePolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "policies/policie-3260/policie-3260/policie-3260"; + + Policy actualResponse = client.deletePolicyAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "policies/policie-3260/policie-3260/policie-3260"; + client.deletePolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listApplicablePoliciesTest() throws Exception { + Policy responsesElement = Policy.newBuilder().build(); + ListApplicablePoliciesResponse expectedResponse = + ListApplicablePoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String attachmentPoint = "attachmentPoint-4653"; + + ListApplicablePoliciesPagedResponse pagedListResponse = + client.listApplicablePolicies(attachmentPoint); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listApplicablePoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String attachmentPoint = "attachmentPoint-4653"; + client.listApplicablePolicies(attachmentPoint); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java b/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java new file mode 100644 index 00000000..5001a4d2 --- /dev/null +++ b/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java @@ -0,0 +1,402 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v2; + +import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; +import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class PoliciesClientTest { + private static MockPolicies mockPolicies; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private PoliciesClient client; + + @BeforeClass + public static void startStaticServer() { + mockPolicies = new MockPolicies(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockPolicies)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + PoliciesSettings settings = + PoliciesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PoliciesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listPoliciesTest() throws Exception { + Policy responsesElement = Policy.newBuilder().build(); + ListPoliciesResponse expectedResponse = + ListPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllPolicies(Arrays.asList(responsesElement)) + .build(); + mockPolicies.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPoliciesPagedResponse pagedListResponse = client.listPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockPolicies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPoliciesRequest actualRequest = ((ListPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPolicies.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + mockPolicies.addResponse(expectedResponse); + + String name = "name3373707"; + + Policy actualResponse = client.getPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPolicies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPolicyRequest actualRequest = ((GetPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPolicies.addException(exception); + + try { + String name = "name3373707"; + client.getPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockPolicies.addResponse(resultOperation); + + String parent = "parent-995424086"; + Policy policy = Policy.newBuilder().build(); + String policyId = "policyId546908653"; + + Policy actualResponse = client.createPolicyAsync(parent, policy, policyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPolicies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePolicyRequest actualRequest = ((CreatePolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertEquals(policyId, actualRequest.getPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPolicies.addException(exception); + + try { + String parent = "parent-995424086"; + Policy policy = Policy.newBuilder().build(); + String policyId = "policyId546908653"; + client.createPolicyAsync(parent, policy, policyId).get(); + 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()); + } + } + + @Test + public void updatePolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockPolicies.addResponse(resultOperation); + + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build(); + + Policy actualResponse = client.updatePolicyAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPolicies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePolicyRequest actualRequest = ((UpdatePolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updatePolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPolicies.addException(exception); + + try { + UpdatePolicyRequest request = + UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build(); + client.updatePolicyAsync(request).get(); + 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()); + } + } + + @Test + public void deletePolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setName("name3373707") + .setUid("uid115792") + .setKind("kind3292052") + .setDisplayName("displayName1714148973") + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .addAllRules(new ArrayList()) + .setManagingAuthority("managingAuthority867537025") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockPolicies.addResponse(resultOperation); + + String name = "name3373707"; + + Policy actualResponse = client.deletePolicyAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPolicies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePolicyRequest actualRequest = ((DeletePolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPolicies.addException(exception); + + try { + String name = "name3373707"; + client.deletePolicyAsync(name).get(); + 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()); + } + } + + @Test + public void listApplicablePoliciesTest() throws Exception { + Policy responsesElement = Policy.newBuilder().build(); + ListApplicablePoliciesResponse expectedResponse = + ListApplicablePoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllPolicies(Arrays.asList(responsesElement)) + .build(); + mockPolicies.addResponse(expectedResponse); + + String attachmentPoint = "attachmentPoint-686994899"; + + ListApplicablePoliciesPagedResponse pagedListResponse = + client.listApplicablePolicies(attachmentPoint); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockPolicies.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListApplicablePoliciesRequest actualRequest = + ((ListApplicablePoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(attachmentPoint, actualRequest.getAttachmentPoint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listApplicablePoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPolicies.addException(exception); + + try { + String attachmentPoint = "attachmentPoint-686994899"; + client.listApplicablePolicies(attachmentPoint); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-iam-v2/pom.xml b/grpc-google-iam-v2/pom.xml new file mode 100644 index 00000000..25ca35fc --- /dev/null +++ b/grpc-google-iam-v2/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-iam-v2 + 1.5.3-SNAPSHOT + grpc-google-iam-v2 + GRPC library for proto-google-iam-v2 + + com.google.cloud + google-iam-parent + 1.5.3-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v2 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java b/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java new file mode 100644 index 00000000..b5b34c76 --- /dev/null +++ b/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java @@ -0,0 +1,971 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.iam.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * An interface for managing Identity and Access Management (IAM) policies.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/iam/v2/policy.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class PoliciesGrpc { + + private PoliciesGrpc() {} + + public static final String SERVICE_NAME = "google.iam.v2.Policies"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v2.ListPoliciesRequest, com.google.iam.v2.ListPoliciesResponse> + getListPoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPolicies", + requestType = com.google.iam.v2.ListPoliciesRequest.class, + responseType = com.google.iam.v2.ListPoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v2.ListPoliciesRequest, com.google.iam.v2.ListPoliciesResponse> + getListPoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v2.ListPoliciesRequest, com.google.iam.v2.ListPoliciesResponse> + getListPoliciesMethod; + if ((getListPoliciesMethod = PoliciesGrpc.getListPoliciesMethod) == null) { + synchronized (PoliciesGrpc.class) { + if ((getListPoliciesMethod = PoliciesGrpc.getListPoliciesMethod) == null) { + PoliciesGrpc.getListPoliciesMethod = + getListPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.ListPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.ListPoliciesResponse.getDefaultInstance())) + .setSchemaDescriptor(new PoliciesMethodDescriptorSupplier("ListPolicies")) + .build(); + } + } + } + return getListPoliciesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v2.GetPolicyRequest, com.google.iam.v2.Policy> + getGetPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPolicy", + requestType = com.google.iam.v2.GetPolicyRequest.class, + responseType = com.google.iam.v2.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v2.GetPolicyRequest, com.google.iam.v2.Policy> + getGetPolicyMethod() { + io.grpc.MethodDescriptor + getGetPolicyMethod; + if ((getGetPolicyMethod = PoliciesGrpc.getGetPolicyMethod) == null) { + synchronized (PoliciesGrpc.class) { + if ((getGetPolicyMethod = PoliciesGrpc.getGetPolicyMethod) == null) { + PoliciesGrpc.getGetPolicyMethod = + getGetPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.GetPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.Policy.getDefaultInstance())) + .setSchemaDescriptor(new PoliciesMethodDescriptorSupplier("GetPolicy")) + .build(); + } + } + } + return getGetPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v2.CreatePolicyRequest, com.google.longrunning.Operation> + getCreatePolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePolicy", + requestType = com.google.iam.v2.CreatePolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v2.CreatePolicyRequest, com.google.longrunning.Operation> + getCreatePolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v2.CreatePolicyRequest, com.google.longrunning.Operation> + getCreatePolicyMethod; + if ((getCreatePolicyMethod = PoliciesGrpc.getCreatePolicyMethod) == null) { + synchronized (PoliciesGrpc.class) { + if ((getCreatePolicyMethod = PoliciesGrpc.getCreatePolicyMethod) == null) { + PoliciesGrpc.getCreatePolicyMethod = + getCreatePolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.CreatePolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new PoliciesMethodDescriptorSupplier("CreatePolicy")) + .build(); + } + } + } + return getCreatePolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v2.UpdatePolicyRequest, com.google.longrunning.Operation> + getUpdatePolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePolicy", + requestType = com.google.iam.v2.UpdatePolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v2.UpdatePolicyRequest, com.google.longrunning.Operation> + getUpdatePolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v2.UpdatePolicyRequest, com.google.longrunning.Operation> + getUpdatePolicyMethod; + if ((getUpdatePolicyMethod = PoliciesGrpc.getUpdatePolicyMethod) == null) { + synchronized (PoliciesGrpc.class) { + if ((getUpdatePolicyMethod = PoliciesGrpc.getUpdatePolicyMethod) == null) { + PoliciesGrpc.getUpdatePolicyMethod = + getUpdatePolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.UpdatePolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new PoliciesMethodDescriptorSupplier("UpdatePolicy")) + .build(); + } + } + } + return getUpdatePolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation> + getDeletePolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePolicy", + requestType = com.google.iam.v2.DeletePolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation> + getDeletePolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation> + getDeletePolicyMethod; + if ((getDeletePolicyMethod = PoliciesGrpc.getDeletePolicyMethod) == null) { + synchronized (PoliciesGrpc.class) { + if ((getDeletePolicyMethod = PoliciesGrpc.getDeletePolicyMethod) == null) { + PoliciesGrpc.getDeletePolicyMethod = + getDeletePolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.DeletePolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new PoliciesMethodDescriptorSupplier("DeletePolicy")) + .build(); + } + } + } + return getDeletePolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v2.ListApplicablePoliciesRequest, + com.google.iam.v2.ListApplicablePoliciesResponse> + getListApplicablePoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListApplicablePolicies", + requestType = com.google.iam.v2.ListApplicablePoliciesRequest.class, + responseType = com.google.iam.v2.ListApplicablePoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v2.ListApplicablePoliciesRequest, + com.google.iam.v2.ListApplicablePoliciesResponse> + getListApplicablePoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v2.ListApplicablePoliciesRequest, + com.google.iam.v2.ListApplicablePoliciesResponse> + getListApplicablePoliciesMethod; + if ((getListApplicablePoliciesMethod = PoliciesGrpc.getListApplicablePoliciesMethod) == null) { + synchronized (PoliciesGrpc.class) { + if ((getListApplicablePoliciesMethod = PoliciesGrpc.getListApplicablePoliciesMethod) + == null) { + PoliciesGrpc.getListApplicablePoliciesMethod = + getListApplicablePoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListApplicablePolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.ListApplicablePoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v2.ListApplicablePoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PoliciesMethodDescriptorSupplier("ListApplicablePolicies")) + .build(); + } + } + } + return getListApplicablePoliciesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PoliciesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesStub(channel, callOptions); + } + }; + return PoliciesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PoliciesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingStub(channel, callOptions); + } + }; + return PoliciesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PoliciesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesFutureStub(channel, callOptions); + } + }; + return PoliciesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * An interface for managing Identity and Access Management (IAM) policies.
+   * 
+ */ + public abstract static class PoliciesImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Retrieves the policies of the specified kind that are attached to a
+     * resource.
+     * The response lists only policy metadata. In particular, policy rules are
+     * omitted.
+     * 
+ */ + public void listPolicies( + com.google.iam.v2.ListPoliciesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPoliciesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a policy.
+     * 
+ */ + public void getPolicy( + com.google.iam.v2.GetPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a policy.
+     * 
+ */ + public void createPolicy( + com.google.iam.v2.CreatePolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified policy.
+     * You can update only the rules and the display name for the policy.
+     * To update a policy, you should use a read-modify-write loop:
+     * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current
+     * version of the policy.
+     * 2. Modify the policy as needed.
+     * 3. Use `UpdatePolicy` to write the updated policy.
+     * This pattern helps prevent conflicts between concurrent updates.
+     * 
+ */ + public void updatePolicy( + com.google.iam.v2.UpdatePolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a policy. This action is permanent.
+     * 
+ */ + public void deletePolicy( + com.google.iam.v2.DeletePolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves all the policies that are attached to the specified resource,
+     * or anywhere in the ancestry of the resource. For example, for a project
+     * this endpoint would return all the `denyPolicy` kind policies attached to
+     * the project, its parent folder (if any), and its parent organization (if
+     * any).
+     * The endpoint requires the same permissions that it would take to call
+     * `ListPolicies` or `GetPolicy`.
+     * The main reason to use this endpoint is as a policy admin to debug access
+     * issues for a resource.
+     * 
+ */ + public void listApplicablePolicies( + com.google.iam.v2.ListApplicablePoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListApplicablePoliciesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListPoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v2.ListPoliciesRequest, + com.google.iam.v2.ListPoliciesResponse>(this, METHODID_LIST_POLICIES))) + .addMethod( + getGetPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + this, METHODID_GET_POLICY))) + .addMethod( + getCreatePolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v2.CreatePolicyRequest, com.google.longrunning.Operation>( + this, METHODID_CREATE_POLICY))) + .addMethod( + getUpdatePolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v2.UpdatePolicyRequest, com.google.longrunning.Operation>( + this, METHODID_UPDATE_POLICY))) + .addMethod( + getDeletePolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation>( + this, METHODID_DELETE_POLICY))) + .addMethod( + getListApplicablePoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v2.ListApplicablePoliciesRequest, + com.google.iam.v2.ListApplicablePoliciesResponse>( + this, METHODID_LIST_APPLICABLE_POLICIES))) + .build(); + } + } + + /** + * + * + *
+   * An interface for managing Identity and Access Management (IAM) policies.
+   * 
+ */ + public static final class PoliciesStub extends io.grpc.stub.AbstractAsyncStub { + private PoliciesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the policies of the specified kind that are attached to a
+     * resource.
+     * The response lists only policy metadata. In particular, policy rules are
+     * omitted.
+     * 
+ */ + public void listPolicies( + com.google.iam.v2.ListPoliciesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a policy.
+     * 
+ */ + public void getPolicy( + com.google.iam.v2.GetPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a policy.
+     * 
+ */ + public void createPolicy( + com.google.iam.v2.CreatePolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified policy.
+     * You can update only the rules and the display name for the policy.
+     * To update a policy, you should use a read-modify-write loop:
+     * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current
+     * version of the policy.
+     * 2. Modify the policy as needed.
+     * 3. Use `UpdatePolicy` to write the updated policy.
+     * This pattern helps prevent conflicts between concurrent updates.
+     * 
+ */ + public void updatePolicy( + com.google.iam.v2.UpdatePolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a policy. This action is permanent.
+     * 
+ */ + public void deletePolicy( + com.google.iam.v2.DeletePolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves all the policies that are attached to the specified resource,
+     * or anywhere in the ancestry of the resource. For example, for a project
+     * this endpoint would return all the `denyPolicy` kind policies attached to
+     * the project, its parent folder (if any), and its parent organization (if
+     * any).
+     * The endpoint requires the same permissions that it would take to call
+     * `ListPolicies` or `GetPolicy`.
+     * The main reason to use this endpoint is as a policy admin to debug access
+     * issues for a resource.
+     * 
+ */ + public void listApplicablePolicies( + com.google.iam.v2.ListApplicablePoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListApplicablePoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * An interface for managing Identity and Access Management (IAM) policies.
+   * 
+ */ + public static final class PoliciesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PoliciesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the policies of the specified kind that are attached to a
+     * resource.
+     * The response lists only policy metadata. In particular, policy rules are
+     * omitted.
+     * 
+ */ + public com.google.iam.v2.ListPoliciesResponse listPolicies( + com.google.iam.v2.ListPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a policy.
+     * 
+ */ + public com.google.iam.v2.Policy getPolicy(com.google.iam.v2.GetPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a policy.
+     * 
+ */ + public com.google.longrunning.Operation createPolicy( + com.google.iam.v2.CreatePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified policy.
+     * You can update only the rules and the display name for the policy.
+     * To update a policy, you should use a read-modify-write loop:
+     * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current
+     * version of the policy.
+     * 2. Modify the policy as needed.
+     * 3. Use `UpdatePolicy` to write the updated policy.
+     * This pattern helps prevent conflicts between concurrent updates.
+     * 
+ */ + public com.google.longrunning.Operation updatePolicy( + com.google.iam.v2.UpdatePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a policy. This action is permanent.
+     * 
+ */ + public com.google.longrunning.Operation deletePolicy( + com.google.iam.v2.DeletePolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves all the policies that are attached to the specified resource,
+     * or anywhere in the ancestry of the resource. For example, for a project
+     * this endpoint would return all the `denyPolicy` kind policies attached to
+     * the project, its parent folder (if any), and its parent organization (if
+     * any).
+     * The endpoint requires the same permissions that it would take to call
+     * `ListPolicies` or `GetPolicy`.
+     * The main reason to use this endpoint is as a policy admin to debug access
+     * issues for a resource.
+     * 
+ */ + public com.google.iam.v2.ListApplicablePoliciesResponse listApplicablePolicies( + com.google.iam.v2.ListApplicablePoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListApplicablePoliciesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * An interface for managing Identity and Access Management (IAM) policies.
+   * 
+ */ + public static final class PoliciesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PoliciesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the policies of the specified kind that are attached to a
+     * resource.
+     * The response lists only policy metadata. In particular, policy rules are
+     * omitted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v2.ListPoliciesResponse> + listPolicies(com.google.iam.v2.ListPoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPoliciesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getPolicy( + com.google.iam.v2.GetPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createPolicy(com.google.iam.v2.CreatePolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified policy.
+     * You can update only the rules and the display name for the policy.
+     * To update a policy, you should use a read-modify-write loop:
+     * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current
+     * version of the policy.
+     * 2. Modify the policy as needed.
+     * 3. Use `UpdatePolicy` to write the updated policy.
+     * This pattern helps prevent conflicts between concurrent updates.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updatePolicy(com.google.iam.v2.UpdatePolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a policy. This action is permanent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deletePolicy(com.google.iam.v2.DeletePolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves all the policies that are attached to the specified resource,
+     * or anywhere in the ancestry of the resource. For example, for a project
+     * this endpoint would return all the `denyPolicy` kind policies attached to
+     * the project, its parent folder (if any), and its parent organization (if
+     * any).
+     * The endpoint requires the same permissions that it would take to call
+     * `ListPolicies` or `GetPolicy`.
+     * The main reason to use this endpoint is as a policy admin to debug access
+     * issues for a resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v2.ListApplicablePoliciesResponse> + listApplicablePolicies(com.google.iam.v2.ListApplicablePoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListApplicablePoliciesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_POLICIES = 0; + private static final int METHODID_GET_POLICY = 1; + private static final int METHODID_CREATE_POLICY = 2; + private static final int METHODID_UPDATE_POLICY = 3; + private static final int METHODID_DELETE_POLICY = 4; + private static final int METHODID_LIST_APPLICABLE_POLICIES = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final PoliciesImplBase serviceImpl; + private final int methodId; + + MethodHandlers(PoliciesImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_POLICIES: + serviceImpl.listPolicies( + (com.google.iam.v2.ListPoliciesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_POLICY: + serviceImpl.getPolicy( + (com.google.iam.v2.GetPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_POLICY: + serviceImpl.createPolicy( + (com.google.iam.v2.CreatePolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_POLICY: + serviceImpl.updatePolicy( + (com.google.iam.v2.UpdatePolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_POLICY: + serviceImpl.deletePolicy( + (com.google.iam.v2.DeletePolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_APPLICABLE_POLICIES: + serviceImpl.listApplicablePolicies( + (com.google.iam.v2.ListApplicablePoliciesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class PoliciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PoliciesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.iam.v2.PolicyProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Policies"); + } + } + + private static final class PoliciesFileDescriptorSupplier extends PoliciesBaseDescriptorSupplier { + PoliciesFileDescriptorSupplier() {} + } + + private static final class PoliciesMethodDescriptorSupplier extends PoliciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + PoliciesMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (PoliciesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PoliciesFileDescriptorSupplier()) + .addMethod(getListPoliciesMethod()) + .addMethod(getGetPolicyMethod()) + .addMethod(getCreatePolicyMethod()) + .addMethod(getUpdatePolicyMethod()) + .addMethod(getDeletePolicyMethod()) + .addMethod(getListApplicablePoliciesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 9e9123a6..21d1d301 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,16 @@ pom import + + com.google.api.grpc + proto-google-iam-v2 + 1.5.3-SNAPSHOT + + + com.google.api.grpc + grpc-google-iam-v2 + 1.5.3-SNAPSHOT + com.google.cloud google-iam-policy @@ -112,7 +122,9 @@ proto-google-iam-v1 grpc-google-iam-v2beta + grpc-google-iam-v2 proto-google-iam-v2beta + proto-google-iam-v2 grpc-google-iam-v1 google-iam-policy diff --git a/proto-google-iam-v2/clirr-ignored-differences.xml b/proto-google-iam-v2/clirr-ignored-differences.xml new file mode 100644 index 00000000..f9346449 --- /dev/null +++ b/proto-google-iam-v2/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/iam/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/iam/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/iam/v2/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-iam-v2/pom.xml b/proto-google-iam-v2/pom.xml new file mode 100644 index 00000000..55b0666e --- /dev/null +++ b/proto-google-iam-v2/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + com.google.api.grpc + proto-google-iam-v2 + 1.5.3-SNAPSHOT + proto-google-iam-v2 + Proto library for proto-google-iam-v1 + + com.google.cloud + google-iam-parent + 1.5.3-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java new file mode 100644 index 00000000..3a88d070 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Request message for `CreatePolicy`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.CreatePolicyRequest} + */ +public final class CreatePolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.CreatePolicyRequest) + CreatePolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatePolicyRequest.newBuilder() to construct. + private CreatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatePolicyRequest() { + parent_ = ""; + policyId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatePolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreatePolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.iam.v2.Policy.Builder subBuilder = null; + if (policy_ != null) { + subBuilder = policy_.toBuilder(); + } + policy_ = input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policy_); + policy_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + policyId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_CreatePolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.CreatePolicyRequest.class, + com.google.iam.v2.CreatePolicyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_FIELD_NUMBER = 2; + private com.google.iam.v2.Policy policy_; + /** + * + * + *
+   * Required. The policy to create.
+   * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * Required. The policy to create.
+   * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v2.Policy getPolicy() { + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; + } + /** + * + * + *
+   * Required. The policy to create.
+   * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + public static final int POLICY_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object policyId_; + /** + * + * + *
+   * The ID to use for this policy, which will become the final component of
+   * the policy's resource name. The ID must contain 3 to 63 characters. It can
+   * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+   * (`.`). The first character must be a lowercase letter.
+   * 
+ * + * string policy_id = 3; + * + * @return The policyId. + */ + @java.lang.Override + public java.lang.String getPolicyId() { + java.lang.Object ref = policyId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID to use for this policy, which will become the final component of
+   * the policy's resource name. The ID must contain 3 to 63 characters. It can
+   * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+   * (`.`). The first character must be a lowercase letter.
+   * 
+ * + * string policy_id = 3; + * + * @return The bytes for policyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyIdBytes() { + java.lang.Object ref = policyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (policy_ != null) { + output.writeMessage(2, getPolicy()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, policyId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicy()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, policyId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.CreatePolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v2.CreatePolicyRequest other = (com.google.iam.v2.CreatePolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (!getPolicyId().equals(other.getPolicyId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + hash = (37 * hash) + POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.CreatePolicyRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.CreatePolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.CreatePolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.CreatePolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `CreatePolicy`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.CreatePolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.CreatePolicyRequest) + com.google.iam.v2.CreatePolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_CreatePolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.CreatePolicyRequest.class, + com.google.iam.v2.CreatePolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v2.CreatePolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + policyId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_CreatePolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.CreatePolicyRequest getDefaultInstanceForType() { + return com.google.iam.v2.CreatePolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.CreatePolicyRequest build() { + com.google.iam.v2.CreatePolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.CreatePolicyRequest buildPartial() { + com.google.iam.v2.CreatePolicyRequest result = + new com.google.iam.v2.CreatePolicyRequest(this); + result.parent_ = parent_; + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + result.policyId_ = policyId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.CreatePolicyRequest) { + return mergeFrom((com.google.iam.v2.CreatePolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.CreatePolicyRequest other) { + if (other == com.google.iam.v2.CreatePolicyRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + if (!other.getPolicyId().isEmpty()) { + policyId_ = other.policyId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.CreatePolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.CreatePolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.iam.v2.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + public com.google.iam.v2.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPolicy(com.google.iam.v2.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPolicy(com.google.iam.v2.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePolicy(com.google.iam.v2.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v2.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.iam.v2.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; + } + } + /** + * + * + *
+     * Required. The policy to create.
+     * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + private java.lang.Object policyId_ = ""; + /** + * + * + *
+     * The ID to use for this policy, which will become the final component of
+     * the policy's resource name. The ID must contain 3 to 63 characters. It can
+     * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+     * (`.`). The first character must be a lowercase letter.
+     * 
+ * + * string policy_id = 3; + * + * @return The policyId. + */ + public java.lang.String getPolicyId() { + java.lang.Object ref = policyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID to use for this policy, which will become the final component of
+     * the policy's resource name. The ID must contain 3 to 63 characters. It can
+     * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+     * (`.`). The first character must be a lowercase letter.
+     * 
+ * + * string policy_id = 3; + * + * @return The bytes for policyId. + */ + public com.google.protobuf.ByteString getPolicyIdBytes() { + java.lang.Object ref = policyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID to use for this policy, which will become the final component of
+     * the policy's resource name. The ID must contain 3 to 63 characters. It can
+     * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+     * (`.`). The first character must be a lowercase letter.
+     * 
+ * + * string policy_id = 3; + * + * @param value The policyId to set. + * @return This builder for chaining. + */ + public Builder setPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + policyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for this policy, which will become the final component of
+     * the policy's resource name. The ID must contain 3 to 63 characters. It can
+     * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+     * (`.`). The first character must be a lowercase letter.
+     * 
+ * + * string policy_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearPolicyId() { + + policyId_ = getDefaultInstance().getPolicyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for this policy, which will become the final component of
+     * the policy's resource name. The ID must contain 3 to 63 characters. It can
+     * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+     * (`.`). The first character must be a lowercase letter.
+     * 
+ * + * string policy_id = 3; + * + * @param value The bytes for policyId to set. + * @return This builder for chaining. + */ + public Builder setPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + policyId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.CreatePolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.CreatePolicyRequest) + private static final com.google.iam.v2.CreatePolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.CreatePolicyRequest(); + } + + public static com.google.iam.v2.CreatePolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreatePolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.CreatePolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java new file mode 100644 index 00000000..35cbef4d --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface CreatePolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.CreatePolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The policy to create.
+   * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * Required. The policy to create.
+   * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + com.google.iam.v2.Policy getPolicy(); + /** + * + * + *
+   * Required. The policy to create.
+   * 
+ * + * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+   * The ID to use for this policy, which will become the final component of
+   * the policy's resource name. The ID must contain 3 to 63 characters. It can
+   * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+   * (`.`). The first character must be a lowercase letter.
+   * 
+ * + * string policy_id = 3; + * + * @return The policyId. + */ + java.lang.String getPolicyId(); + /** + * + * + *
+   * The ID to use for this policy, which will become the final component of
+   * the policy's resource name. The ID must contain 3 to 63 characters. It can
+   * contain lowercase letters and numbers, as well as dashes (`-`) and periods
+   * (`.`). The first character must be a lowercase letter.
+   * 
+ * + * string policy_id = 3; + * + * @return The bytes for policyId. + */ + com.google.protobuf.ByteString getPolicyIdBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java new file mode 100644 index 00000000..44d2147b --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java @@ -0,0 +1,883 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Request message for `DeletePolicy`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.DeletePolicyRequest} + */ +public final class DeletePolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.DeletePolicyRequest) + DeletePolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletePolicyRequest.newBuilder() to construct. + private DeletePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletePolicyRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletePolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeletePolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_DeletePolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.DeletePolicyRequest.class, + com.google.iam.v2.DeletePolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the policy to delete. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the policy to delete. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. The expected `etag` of the policy to delete. If the value does
+   * not match the value that is stored in IAM, the request fails with a `409`
+   * error code and `ABORTED` status.
+   * If you omit this field, the policy is deleted regardless of its current
+   * `etag`.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The expected `etag` of the policy to delete. If the value does
+   * not match the value that is stored in IAM, the request fails with a `409`
+   * error code and `ABORTED` status.
+   * If you omit this field, the policy is deleted regardless of its current
+   * `etag`.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.DeletePolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v2.DeletePolicyRequest other = (com.google.iam.v2.DeletePolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.DeletePolicyRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.DeletePolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.DeletePolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.DeletePolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `DeletePolicy`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.DeletePolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.DeletePolicyRequest) + com.google.iam.v2.DeletePolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_DeletePolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.DeletePolicyRequest.class, + com.google.iam.v2.DeletePolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v2.DeletePolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_DeletePolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.DeletePolicyRequest getDefaultInstanceForType() { + return com.google.iam.v2.DeletePolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.DeletePolicyRequest build() { + com.google.iam.v2.DeletePolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.DeletePolicyRequest buildPartial() { + com.google.iam.v2.DeletePolicyRequest result = + new com.google.iam.v2.DeletePolicyRequest(this); + result.name_ = name_; + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.DeletePolicyRequest) { + return mergeFrom((com.google.iam.v2.DeletePolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.DeletePolicyRequest other) { + if (other == com.google.iam.v2.DeletePolicyRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.DeletePolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.DeletePolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the policy to delete. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the policy to delete. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the policy to delete. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the policy to delete. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the policy to delete. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The expected `etag` of the policy to delete. If the value does
+     * not match the value that is stored in IAM, the request fails with a `409`
+     * error code and `ABORTED` status.
+     * If you omit this field, the policy is deleted regardless of its current
+     * `etag`.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The expected `etag` of the policy to delete. If the value does
+     * not match the value that is stored in IAM, the request fails with a `409`
+     * error code and `ABORTED` status.
+     * If you omit this field, the policy is deleted regardless of its current
+     * `etag`.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The expected `etag` of the policy to delete. If the value does
+     * not match the value that is stored in IAM, the request fails with a `409`
+     * error code and `ABORTED` status.
+     * If you omit this field, the policy is deleted regardless of its current
+     * `etag`.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The expected `etag` of the policy to delete. If the value does
+     * not match the value that is stored in IAM, the request fails with a `409`
+     * error code and `ABORTED` status.
+     * If you omit this field, the policy is deleted regardless of its current
+     * `etag`.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The expected `etag` of the policy to delete. If the value does
+     * not match the value that is stored in IAM, the request fails with a `409`
+     * error code and `ABORTED` status.
+     * If you omit this field, the policy is deleted regardless of its current
+     * `etag`.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.DeletePolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.DeletePolicyRequest) + private static final com.google.iam.v2.DeletePolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.DeletePolicyRequest(); + } + + public static com.google.iam.v2.DeletePolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeletePolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.DeletePolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java new file mode 100644 index 00000000..a0d077f2 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface DeletePolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.DeletePolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the policy to delete. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the policy to delete. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The expected `etag` of the policy to delete. If the value does
+   * not match the value that is stored in IAM, the request fails with a `409`
+   * error code and `ABORTED` status.
+   * If you omit this field, the policy is deleted regardless of its current
+   * `etag`.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The expected `etag` of the policy to delete. If the value does
+   * not match the value that is stored in IAM, the request fails with a `409`
+   * error code and `ABORTED` status.
+   * If you omit this field, the policy is deleted regardless of its current
+   * `etag`.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java new file mode 100644 index 00000000..61475584 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java @@ -0,0 +1,2504 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/deny.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * A deny rule in an IAM deny policy.
+ * 
+ * + * Protobuf type {@code google.iam.v2.DenyRule} + */ +public final class DenyRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.DenyRule) + DenyRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use DenyRule.newBuilder() to construct. + private DenyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DenyRule() { + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DenyRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DenyRule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deniedPrincipals_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deniedPrincipals_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + exceptionPrincipals_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + exceptionPrincipals_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + deniedPermissions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + deniedPermissions_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + exceptionPermissions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + exceptionPermissions_.add(s); + break; + } + case 42: + { + com.google.type.Expr.Builder subBuilder = null; + if (denialCondition_ != null) { + subBuilder = denialCondition_.toBuilder(); + } + denialCondition_ = + input.readMessage(com.google.type.Expr.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(denialCondition_); + denialCondition_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + deniedPrincipals_ = deniedPrincipals_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + exceptionPrincipals_ = exceptionPrincipals_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + deniedPermissions_ = deniedPermissions_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + exceptionPermissions_ = exceptionPermissions_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.DenyRuleProto.internal_static_google_iam_v2_DenyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.DenyRuleProto.internal_static_google_iam_v2_DenyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.DenyRule.class, com.google.iam.v2.DenyRule.Builder.class); + } + + public static final int DENIED_PRINCIPALS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList deniedPrincipals_; + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @return A list containing the deniedPrincipals. + */ + public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { + return deniedPrincipals_; + } + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @return The count of deniedPrincipals. + */ + public int getDeniedPrincipalsCount() { + return deniedPrincipals_.size(); + } + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index of the element to return. + * @return The deniedPrincipals at the given index. + */ + public java.lang.String getDeniedPrincipals(int index) { + return deniedPrincipals_.get(index); + } + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index of the value to return. + * @return The bytes of the deniedPrincipals at the given index. + */ + public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { + return deniedPrincipals_.getByteString(index); + } + + public static final int EXCEPTION_PRINCIPALS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList exceptionPrincipals_; + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @return A list containing the exceptionPrincipals. + */ + public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { + return exceptionPrincipals_; + } + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @return The count of exceptionPrincipals. + */ + public int getExceptionPrincipalsCount() { + return exceptionPrincipals_.size(); + } + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index of the element to return. + * @return The exceptionPrincipals at the given index. + */ + public java.lang.String getExceptionPrincipals(int index) { + return exceptionPrincipals_.get(index); + } + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index of the value to return. + * @return The bytes of the exceptionPrincipals at the given index. + */ + public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { + return exceptionPrincipals_.getByteString(index); + } + + public static final int DENIED_PERMISSIONS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList deniedPermissions_; + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @return A list containing the deniedPermissions. + */ + public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { + return deniedPermissions_; + } + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @return The count of deniedPermissions. + */ + public int getDeniedPermissionsCount() { + return deniedPermissions_.size(); + } + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index of the element to return. + * @return The deniedPermissions at the given index. + */ + public java.lang.String getDeniedPermissions(int index) { + return deniedPermissions_.get(index); + } + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index of the value to return. + * @return The bytes of the deniedPermissions at the given index. + */ + public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { + return deniedPermissions_.getByteString(index); + } + + public static final int EXCEPTION_PERMISSIONS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList exceptionPermissions_; + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @return A list containing the exceptionPermissions. + */ + public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { + return exceptionPermissions_; + } + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @return The count of exceptionPermissions. + */ + public int getExceptionPermissionsCount() { + return exceptionPermissions_.size(); + } + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index of the element to return. + * @return The exceptionPermissions at the given index. + */ + public java.lang.String getExceptionPermissions(int index) { + return exceptionPermissions_.get(index); + } + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index of the value to return. + * @return The bytes of the exceptionPermissions at the given index. + */ + public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { + return exceptionPermissions_.getByteString(index); + } + + public static final int DENIAL_CONDITION_FIELD_NUMBER = 5; + private com.google.type.Expr denialCondition_; + /** + * + * + *
+   * The condition that determines whether this deny rule applies to a request.
+   * If the condition expression evaluates to `true`, then the deny rule is
+   * applied; otherwise, the deny rule is not applied.
+   * Each deny rule is evaluated independently. If this deny rule does not apply
+   * to a request, other deny rules might still apply.
+   * The condition can use CEL functions that evaluate
+   * [resource
+   * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+   * functions and operators are not supported.
+   * 
+ * + * .google.type.Expr denial_condition = 5; + * + * @return Whether the denialCondition field is set. + */ + @java.lang.Override + public boolean hasDenialCondition() { + return denialCondition_ != null; + } + /** + * + * + *
+   * The condition that determines whether this deny rule applies to a request.
+   * If the condition expression evaluates to `true`, then the deny rule is
+   * applied; otherwise, the deny rule is not applied.
+   * Each deny rule is evaluated independently. If this deny rule does not apply
+   * to a request, other deny rules might still apply.
+   * The condition can use CEL functions that evaluate
+   * [resource
+   * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+   * functions and operators are not supported.
+   * 
+ * + * .google.type.Expr denial_condition = 5; + * + * @return The denialCondition. + */ + @java.lang.Override + public com.google.type.Expr getDenialCondition() { + return denialCondition_ == null ? com.google.type.Expr.getDefaultInstance() : denialCondition_; + } + /** + * + * + *
+   * The condition that determines whether this deny rule applies to a request.
+   * If the condition expression evaluates to `true`, then the deny rule is
+   * applied; otherwise, the deny rule is not applied.
+   * Each deny rule is evaluated independently. If this deny rule does not apply
+   * to a request, other deny rules might still apply.
+   * The condition can use CEL functions that evaluate
+   * [resource
+   * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+   * functions and operators are not supported.
+   * 
+ * + * .google.type.Expr denial_condition = 5; + */ + @java.lang.Override + public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { + return getDenialCondition(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < deniedPrincipals_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deniedPrincipals_.getRaw(i)); + } + for (int i = 0; i < exceptionPrincipals_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, exceptionPrincipals_.getRaw(i)); + } + for (int i = 0; i < deniedPermissions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deniedPermissions_.getRaw(i)); + } + for (int i = 0; i < exceptionPermissions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 4, exceptionPermissions_.getRaw(i)); + } + if (denialCondition_ != null) { + output.writeMessage(5, getDenialCondition()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < deniedPrincipals_.size(); i++) { + dataSize += computeStringSizeNoTag(deniedPrincipals_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeniedPrincipalsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < exceptionPrincipals_.size(); i++) { + dataSize += computeStringSizeNoTag(exceptionPrincipals_.getRaw(i)); + } + size += dataSize; + size += 1 * getExceptionPrincipalsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < deniedPermissions_.size(); i++) { + dataSize += computeStringSizeNoTag(deniedPermissions_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeniedPermissionsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < exceptionPermissions_.size(); i++) { + dataSize += computeStringSizeNoTag(exceptionPermissions_.getRaw(i)); + } + size += dataSize; + size += 1 * getExceptionPermissionsList().size(); + } + if (denialCondition_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDenialCondition()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.DenyRule)) { + return super.equals(obj); + } + com.google.iam.v2.DenyRule other = (com.google.iam.v2.DenyRule) obj; + + if (!getDeniedPrincipalsList().equals(other.getDeniedPrincipalsList())) return false; + if (!getExceptionPrincipalsList().equals(other.getExceptionPrincipalsList())) return false; + if (!getDeniedPermissionsList().equals(other.getDeniedPermissionsList())) return false; + if (!getExceptionPermissionsList().equals(other.getExceptionPermissionsList())) return false; + if (hasDenialCondition() != other.hasDenialCondition()) return false; + if (hasDenialCondition()) { + if (!getDenialCondition().equals(other.getDenialCondition())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDeniedPrincipalsCount() > 0) { + hash = (37 * hash) + DENIED_PRINCIPALS_FIELD_NUMBER; + hash = (53 * hash) + getDeniedPrincipalsList().hashCode(); + } + if (getExceptionPrincipalsCount() > 0) { + hash = (37 * hash) + EXCEPTION_PRINCIPALS_FIELD_NUMBER; + hash = (53 * hash) + getExceptionPrincipalsList().hashCode(); + } + if (getDeniedPermissionsCount() > 0) { + hash = (37 * hash) + DENIED_PERMISSIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeniedPermissionsList().hashCode(); + } + if (getExceptionPermissionsCount() > 0) { + hash = (37 * hash) + EXCEPTION_PERMISSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExceptionPermissionsList().hashCode(); + } + if (hasDenialCondition()) { + hash = (37 * hash) + DENIAL_CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getDenialCondition().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.DenyRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.DenyRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.DenyRule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.DenyRule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.DenyRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.DenyRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.DenyRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.DenyRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.DenyRule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.DenyRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.DenyRule parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.DenyRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.DenyRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A deny rule in an IAM deny policy.
+   * 
+ * + * Protobuf type {@code google.iam.v2.DenyRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.DenyRule) + com.google.iam.v2.DenyRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.DenyRuleProto.internal_static_google_iam_v2_DenyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.DenyRuleProto + .internal_static_google_iam_v2_DenyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.DenyRule.class, com.google.iam.v2.DenyRule.Builder.class); + } + + // Construct using com.google.iam.v2.DenyRule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + if (denialConditionBuilder_ == null) { + denialCondition_ = null; + } else { + denialCondition_ = null; + denialConditionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.DenyRuleProto.internal_static_google_iam_v2_DenyRule_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.DenyRule getDefaultInstanceForType() { + return com.google.iam.v2.DenyRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.DenyRule build() { + com.google.iam.v2.DenyRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.DenyRule buildPartial() { + com.google.iam.v2.DenyRule result = new com.google.iam.v2.DenyRule(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + deniedPrincipals_ = deniedPrincipals_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deniedPrincipals_ = deniedPrincipals_; + if (((bitField0_ & 0x00000002) != 0)) { + exceptionPrincipals_ = exceptionPrincipals_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.exceptionPrincipals_ = exceptionPrincipals_; + if (((bitField0_ & 0x00000004) != 0)) { + deniedPermissions_ = deniedPermissions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.deniedPermissions_ = deniedPermissions_; + if (((bitField0_ & 0x00000008) != 0)) { + exceptionPermissions_ = exceptionPermissions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.exceptionPermissions_ = exceptionPermissions_; + if (denialConditionBuilder_ == null) { + result.denialCondition_ = denialCondition_; + } else { + result.denialCondition_ = denialConditionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.DenyRule) { + return mergeFrom((com.google.iam.v2.DenyRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.DenyRule other) { + if (other == com.google.iam.v2.DenyRule.getDefaultInstance()) return this; + if (!other.deniedPrincipals_.isEmpty()) { + if (deniedPrincipals_.isEmpty()) { + deniedPrincipals_ = other.deniedPrincipals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeniedPrincipalsIsMutable(); + deniedPrincipals_.addAll(other.deniedPrincipals_); + } + onChanged(); + } + if (!other.exceptionPrincipals_.isEmpty()) { + if (exceptionPrincipals_.isEmpty()) { + exceptionPrincipals_ = other.exceptionPrincipals_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureExceptionPrincipalsIsMutable(); + exceptionPrincipals_.addAll(other.exceptionPrincipals_); + } + onChanged(); + } + if (!other.deniedPermissions_.isEmpty()) { + if (deniedPermissions_.isEmpty()) { + deniedPermissions_ = other.deniedPermissions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureDeniedPermissionsIsMutable(); + deniedPermissions_.addAll(other.deniedPermissions_); + } + onChanged(); + } + if (!other.exceptionPermissions_.isEmpty()) { + if (exceptionPermissions_.isEmpty()) { + exceptionPermissions_ = other.exceptionPermissions_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureExceptionPermissionsIsMutable(); + exceptionPermissions_.addAll(other.exceptionPermissions_); + } + onChanged(); + } + if (other.hasDenialCondition()) { + mergeDenialCondition(other.getDenialCondition()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.DenyRule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.DenyRule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList deniedPrincipals_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDeniedPrincipalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deniedPrincipals_ = new com.google.protobuf.LazyStringArrayList(deniedPrincipals_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @return A list containing the deniedPrincipals. + */ + public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { + return deniedPrincipals_.getUnmodifiableView(); + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @return The count of deniedPrincipals. + */ + public int getDeniedPrincipalsCount() { + return deniedPrincipals_.size(); + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index of the element to return. + * @return The deniedPrincipals at the given index. + */ + public java.lang.String getDeniedPrincipals(int index) { + return deniedPrincipals_.get(index); + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index of the value to return. + * @return The bytes of the deniedPrincipals at the given index. + */ + public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { + return deniedPrincipals_.getByteString(index); + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index to set the value at. + * @param value The deniedPrincipals to set. + * @return This builder for chaining. + */ + public Builder setDeniedPrincipals(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedPrincipalsIsMutable(); + deniedPrincipals_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @param value The deniedPrincipals to add. + * @return This builder for chaining. + */ + public Builder addDeniedPrincipals(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedPrincipalsIsMutable(); + deniedPrincipals_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @param values The deniedPrincipals to add. + * @return This builder for chaining. + */ + public Builder addAllDeniedPrincipals(java.lang.Iterable values) { + ensureDeniedPrincipalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedPrincipals_); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @return This builder for chaining. + */ + public Builder clearDeniedPrincipals() { + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are prevented from using one or more permissions on
+     * Google Cloud resources. This field can contain the following values:
+     * * `principalSet://goog/public:all`: A special identifier that represents
+     *   any principal that is on the internet, even if they do not have a Google
+     *   Account or are not logged in.
+     * * `principal://goog/subject/{email_id}`: A specific Google Account.
+     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+     *   example, `principal://goog/subject/alice@example.com`.
+     * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+     *   Google Account that was deleted recently. For example,
+     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+     *   the Google Account is recovered, this identifier reverts to the standard
+     *   identifier for a Google Account.
+     * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+     *   `principalSet://goog/group/admins@example.com`.
+     * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+     *   that was deleted recently. For example,
+     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+     *   the Google group is restored, this identifier reverts to the standard
+     *   identifier for a Google group.
+     * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+     *   A Google Cloud service account. For example,
+     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+     * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+     *   A Google Cloud service account that was deleted recently. For example,
+     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+     *   If the service account is undeleted, this identifier reverts to the
+     *   standard identifier for a service account.
+     * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+     *   principals associated with the specified Google Workspace or Cloud
+     *   Identity customer ID. For example,
+     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+     * 
+ * + * repeated string denied_principals = 1; + * + * @param value The bytes of the deniedPrincipals to add. + * @return This builder for chaining. + */ + public Builder addDeniedPrincipalsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDeniedPrincipalsIsMutable(); + deniedPrincipals_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList exceptionPrincipals_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExceptionPrincipalsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + exceptionPrincipals_ = new com.google.protobuf.LazyStringArrayList(exceptionPrincipals_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @return A list containing the exceptionPrincipals. + */ + public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { + return exceptionPrincipals_.getUnmodifiableView(); + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @return The count of exceptionPrincipals. + */ + public int getExceptionPrincipalsCount() { + return exceptionPrincipals_.size(); + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index of the element to return. + * @return The exceptionPrincipals at the given index. + */ + public java.lang.String getExceptionPrincipals(int index) { + return exceptionPrincipals_.get(index); + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index of the value to return. + * @return The bytes of the exceptionPrincipals at the given index. + */ + public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { + return exceptionPrincipals_.getByteString(index); + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index to set the value at. + * @param value The exceptionPrincipals to set. + * @return This builder for chaining. + */ + public Builder setExceptionPrincipals(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExceptionPrincipalsIsMutable(); + exceptionPrincipals_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @param value The exceptionPrincipals to add. + * @return This builder for chaining. + */ + public Builder addExceptionPrincipals(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExceptionPrincipalsIsMutable(); + exceptionPrincipals_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @param values The exceptionPrincipals to add. + * @return This builder for chaining. + */ + public Builder addAllExceptionPrincipals(java.lang.Iterable values) { + ensureExceptionPrincipalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exceptionPrincipals_); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @return This builder for chaining. + */ + public Builder clearExceptionPrincipals() { + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The identities that are excluded from the deny rule, even if they are
+     * listed in the `denied_principals`. For example, you could add a Google
+     * group to the `denied_principals`, then exclude specific users who belong to
+     * that group.
+     * This field can contain the same values as the `denied_principals` field,
+     * excluding `principalSet://goog/public:all`, which represents all users on
+     * the internet.
+     * 
+ * + * repeated string exception_principals = 2; + * + * @param value The bytes of the exceptionPrincipals to add. + * @return This builder for chaining. + */ + public Builder addExceptionPrincipalsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExceptionPrincipalsIsMutable(); + exceptionPrincipals_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList deniedPermissions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDeniedPermissionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + deniedPermissions_ = new com.google.protobuf.LazyStringArrayList(deniedPermissions_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @return A list containing the deniedPermissions. + */ + public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { + return deniedPermissions_.getUnmodifiableView(); + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @return The count of deniedPermissions. + */ + public int getDeniedPermissionsCount() { + return deniedPermissions_.size(); + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index of the element to return. + * @return The deniedPermissions at the given index. + */ + public java.lang.String getDeniedPermissions(int index) { + return deniedPermissions_.get(index); + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index of the value to return. + * @return The bytes of the deniedPermissions at the given index. + */ + public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { + return deniedPermissions_.getByteString(index); + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index to set the value at. + * @param value The deniedPermissions to set. + * @return This builder for chaining. + */ + public Builder setDeniedPermissions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedPermissionsIsMutable(); + deniedPermissions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @param value The deniedPermissions to add. + * @return This builder for chaining. + */ + public Builder addDeniedPermissions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedPermissionsIsMutable(); + deniedPermissions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @param values The deniedPermissions to add. + * @return This builder for chaining. + */ + public Builder addAllDeniedPermissions(java.lang.Iterable values) { + ensureDeniedPermissionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedPermissions_); + onChanged(); + return this; + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @return This builder for chaining. + */ + public Builder clearDeniedPermissions() { + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The permissions that are explicitly denied by this rule. Each permission
+     * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+     * is the fully qualified domain name for the service. For example,
+     * `iam.googleapis.com/roles.list`.
+     * 
+ * + * repeated string denied_permissions = 3; + * + * @param value The bytes of the deniedPermissions to add. + * @return This builder for chaining. + */ + public Builder addDeniedPermissionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDeniedPermissionsIsMutable(); + deniedPermissions_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList exceptionPermissions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureExceptionPermissionsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + exceptionPermissions_ = new com.google.protobuf.LazyStringArrayList(exceptionPermissions_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @return A list containing the exceptionPermissions. + */ + public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { + return exceptionPermissions_.getUnmodifiableView(); + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @return The count of exceptionPermissions. + */ + public int getExceptionPermissionsCount() { + return exceptionPermissions_.size(); + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index of the element to return. + * @return The exceptionPermissions at the given index. + */ + public java.lang.String getExceptionPermissions(int index) { + return exceptionPermissions_.get(index); + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index of the value to return. + * @return The bytes of the exceptionPermissions at the given index. + */ + public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { + return exceptionPermissions_.getByteString(index); + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index to set the value at. + * @param value The exceptionPermissions to set. + * @return This builder for chaining. + */ + public Builder setExceptionPermissions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExceptionPermissionsIsMutable(); + exceptionPermissions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @param value The exceptionPermissions to add. + * @return This builder for chaining. + */ + public Builder addExceptionPermissions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExceptionPermissionsIsMutable(); + exceptionPermissions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @param values The exceptionPermissions to add. + * @return This builder for chaining. + */ + public Builder addAllExceptionPermissions(java.lang.Iterable values) { + ensureExceptionPermissionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exceptionPermissions_); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @return This builder for chaining. + */ + public Builder clearExceptionPermissions() { + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the permissions that this rule excludes from the set of denied
+     * permissions given by `denied_permissions`. If a permission appears in
+     * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+     * denied.
+     * The excluded permissions can be specified using the same syntax as
+     * `denied_permissions`.
+     * 
+ * + * repeated string exception_permissions = 4; + * + * @param value The bytes of the exceptionPermissions to add. + * @return This builder for chaining. + */ + public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExceptionPermissionsIsMutable(); + exceptionPermissions_.add(value); + onChanged(); + return this; + } + + private com.google.type.Expr denialCondition_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + denialConditionBuilder_; + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + * + * @return Whether the denialCondition field is set. + */ + public boolean hasDenialCondition() { + return denialConditionBuilder_ != null || denialCondition_ != null; + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + * + * @return The denialCondition. + */ + public com.google.type.Expr getDenialCondition() { + if (denialConditionBuilder_ == null) { + return denialCondition_ == null + ? com.google.type.Expr.getDefaultInstance() + : denialCondition_; + } else { + return denialConditionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + public Builder setDenialCondition(com.google.type.Expr value) { + if (denialConditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + denialCondition_ = value; + onChanged(); + } else { + denialConditionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) { + if (denialConditionBuilder_ == null) { + denialCondition_ = builderForValue.build(); + onChanged(); + } else { + denialConditionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + public Builder mergeDenialCondition(com.google.type.Expr value) { + if (denialConditionBuilder_ == null) { + if (denialCondition_ != null) { + denialCondition_ = + com.google.type.Expr.newBuilder(denialCondition_).mergeFrom(value).buildPartial(); + } else { + denialCondition_ = value; + } + onChanged(); + } else { + denialConditionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + public Builder clearDenialCondition() { + if (denialConditionBuilder_ == null) { + denialCondition_ = null; + onChanged(); + } else { + denialCondition_ = null; + denialConditionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + public com.google.type.Expr.Builder getDenialConditionBuilder() { + + onChanged(); + return getDenialConditionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { + if (denialConditionBuilder_ != null) { + return denialConditionBuilder_.getMessageOrBuilder(); + } else { + return denialCondition_ == null + ? com.google.type.Expr.getDefaultInstance() + : denialCondition_; + } + } + /** + * + * + *
+     * The condition that determines whether this deny rule applies to a request.
+     * If the condition expression evaluates to `true`, then the deny rule is
+     * applied; otherwise, the deny rule is not applied.
+     * Each deny rule is evaluated independently. If this deny rule does not apply
+     * to a request, other deny rules might still apply.
+     * The condition can use CEL functions that evaluate
+     * [resource
+     * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+     * functions and operators are not supported.
+     * 
+ * + * .google.type.Expr denial_condition = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + getDenialConditionFieldBuilder() { + if (denialConditionBuilder_ == null) { + denialConditionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( + getDenialCondition(), getParentForChildren(), isClean()); + denialCondition_ = null; + } + return denialConditionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.DenyRule) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.DenyRule) + private static final com.google.iam.v2.DenyRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.DenyRule(); + } + + public static com.google.iam.v2.DenyRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DenyRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DenyRule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.DenyRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java new file mode 100644 index 00000000..1d35367f --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java @@ -0,0 +1,468 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/deny.proto + +package com.google.iam.v2; + +public interface DenyRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.DenyRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @return A list containing the deniedPrincipals. + */ + java.util.List getDeniedPrincipalsList(); + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @return The count of deniedPrincipals. + */ + int getDeniedPrincipalsCount(); + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index of the element to return. + * @return The deniedPrincipals at the given index. + */ + java.lang.String getDeniedPrincipals(int index); + /** + * + * + *
+   * The identities that are prevented from using one or more permissions on
+   * Google Cloud resources. This field can contain the following values:
+   * * `principalSet://goog/public:all`: A special identifier that represents
+   *   any principal that is on the internet, even if they do not have a Google
+   *   Account or are not logged in.
+   * * `principal://goog/subject/{email_id}`: A specific Google Account.
+   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
+   *   example, `principal://goog/subject/alice@example.com`.
+   * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
+   *   Google Account that was deleted recently. For example,
+   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
+   *   the Google Account is recovered, this identifier reverts to the standard
+   *   identifier for a Google Account.
+   * * `principalSet://goog/group/{group_id}`: A Google group. For example,
+   *   `principalSet://goog/group/admins@example.com`.
+   * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
+   *   that was deleted recently. For example,
+   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
+   *   the Google group is restored, this identifier reverts to the standard
+   *   identifier for a Google group.
+   * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
+   *   A Google Cloud service account. For example,
+   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
+   * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
+   *   A Google Cloud service account that was deleted recently. For example,
+   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
+   *   If the service account is undeleted, this identifier reverts to the
+   *   standard identifier for a service account.
+   * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
+   *   principals associated with the specified Google Workspace or Cloud
+   *   Identity customer ID. For example,
+   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
+   * 
+ * + * repeated string denied_principals = 1; + * + * @param index The index of the value to return. + * @return The bytes of the deniedPrincipals at the given index. + */ + com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index); + + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @return A list containing the exceptionPrincipals. + */ + java.util.List getExceptionPrincipalsList(); + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @return The count of exceptionPrincipals. + */ + int getExceptionPrincipalsCount(); + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index of the element to return. + * @return The exceptionPrincipals at the given index. + */ + java.lang.String getExceptionPrincipals(int index); + /** + * + * + *
+   * The identities that are excluded from the deny rule, even if they are
+   * listed in the `denied_principals`. For example, you could add a Google
+   * group to the `denied_principals`, then exclude specific users who belong to
+   * that group.
+   * This field can contain the same values as the `denied_principals` field,
+   * excluding `principalSet://goog/public:all`, which represents all users on
+   * the internet.
+   * 
+ * + * repeated string exception_principals = 2; + * + * @param index The index of the value to return. + * @return The bytes of the exceptionPrincipals at the given index. + */ + com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index); + + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @return A list containing the deniedPermissions. + */ + java.util.List getDeniedPermissionsList(); + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @return The count of deniedPermissions. + */ + int getDeniedPermissionsCount(); + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index of the element to return. + * @return The deniedPermissions at the given index. + */ + java.lang.String getDeniedPermissions(int index); + /** + * + * + *
+   * The permissions that are explicitly denied by this rule. Each permission
+   * uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}`
+   * is the fully qualified domain name for the service. For example,
+   * `iam.googleapis.com/roles.list`.
+   * 
+ * + * repeated string denied_permissions = 3; + * + * @param index The index of the value to return. + * @return The bytes of the deniedPermissions at the given index. + */ + com.google.protobuf.ByteString getDeniedPermissionsBytes(int index); + + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @return A list containing the exceptionPermissions. + */ + java.util.List getExceptionPermissionsList(); + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @return The count of exceptionPermissions. + */ + int getExceptionPermissionsCount(); + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index of the element to return. + * @return The exceptionPermissions at the given index. + */ + java.lang.String getExceptionPermissions(int index); + /** + * + * + *
+   * Specifies the permissions that this rule excludes from the set of denied
+   * permissions given by `denied_permissions`. If a permission appears in
+   * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be
+   * denied.
+   * The excluded permissions can be specified using the same syntax as
+   * `denied_permissions`.
+   * 
+ * + * repeated string exception_permissions = 4; + * + * @param index The index of the value to return. + * @return The bytes of the exceptionPermissions at the given index. + */ + com.google.protobuf.ByteString getExceptionPermissionsBytes(int index); + + /** + * + * + *
+   * The condition that determines whether this deny rule applies to a request.
+   * If the condition expression evaluates to `true`, then the deny rule is
+   * applied; otherwise, the deny rule is not applied.
+   * Each deny rule is evaluated independently. If this deny rule does not apply
+   * to a request, other deny rules might still apply.
+   * The condition can use CEL functions that evaluate
+   * [resource
+   * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+   * functions and operators are not supported.
+   * 
+ * + * .google.type.Expr denial_condition = 5; + * + * @return Whether the denialCondition field is set. + */ + boolean hasDenialCondition(); + /** + * + * + *
+   * The condition that determines whether this deny rule applies to a request.
+   * If the condition expression evaluates to `true`, then the deny rule is
+   * applied; otherwise, the deny rule is not applied.
+   * Each deny rule is evaluated independently. If this deny rule does not apply
+   * to a request, other deny rules might still apply.
+   * The condition can use CEL functions that evaluate
+   * [resource
+   * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+   * functions and operators are not supported.
+   * 
+ * + * .google.type.Expr denial_condition = 5; + * + * @return The denialCondition. + */ + com.google.type.Expr getDenialCondition(); + /** + * + * + *
+   * The condition that determines whether this deny rule applies to a request.
+   * If the condition expression evaluates to `true`, then the deny rule is
+   * applied; otherwise, the deny rule is not applied.
+   * Each deny rule is evaluated independently. If this deny rule does not apply
+   * to a request, other deny rules might still apply.
+   * The condition can use CEL functions that evaluate
+   * [resource
+   * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other
+   * functions and operators are not supported.
+   * 
+ * + * .google.type.Expr denial_condition = 5; + */ + com.google.type.ExprOrBuilder getDenialConditionOrBuilder(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java new file mode 100644 index 00000000..55a5ff75 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/deny.proto + +package com.google.iam.v2; + +public final class DenyRuleProto { + private DenyRuleProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_DenyRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_DenyRule_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\030google/iam/v2/deny.proto\022\rgoogle.iam.v" + + "2\032\026google/type/expr.proto\"\253\001\n\010DenyRule\022\031" + + "\n\021denied_principals\030\001 \003(\t\022\034\n\024exception_p" + + "rincipals\030\002 \003(\t\022\032\n\022denied_permissions\030\003 " + + "\003(\t\022\035\n\025exception_permissions\030\004 \003(\t\022+\n\020de" + + "nial_condition\030\005 \001(\0132\021.google.type.ExprB" + + "\202\001\n\021com.google.iam.v2B\rDenyRuleProtoP\001Z0" + + "google.golang.org/genproto/googleapis/ia" + + "m/v2;iam\252\002\023Google.Cloud.Iam.V2\312\002\023Google\\" + + "Cloud\\Iam\\V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.type.ExprProto.getDescriptor(), + }); + internal_static_google_iam_v2_DenyRule_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v2_DenyRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_DenyRule_descriptor, + new java.lang.String[] { + "DeniedPrincipals", + "ExceptionPrincipals", + "DeniedPermissions", + "ExceptionPermissions", + "DenialCondition", + }); + com.google.type.ExprProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java new file mode 100644 index 00000000..89594074 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java @@ -0,0 +1,674 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Request message for `GetPolicy`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.GetPolicyRequest} + */ +public final class GetPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.GetPolicyRequest) + GetPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPolicyRequest.newBuilder() to construct. + private GetPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_GetPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.GetPolicyRequest.class, + com.google.iam.v2.GetPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the policy to retrieve. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the policy to retrieve. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.GetPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v2.GetPolicyRequest other = (com.google.iam.v2.GetPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.GetPolicyRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.GetPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.GetPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.GetPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `GetPolicy`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.GetPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.GetPolicyRequest) + com.google.iam.v2.GetPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_GetPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.GetPolicyRequest.class, + com.google.iam.v2.GetPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v2.GetPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_GetPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.GetPolicyRequest getDefaultInstanceForType() { + return com.google.iam.v2.GetPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.GetPolicyRequest build() { + com.google.iam.v2.GetPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.GetPolicyRequest buildPartial() { + com.google.iam.v2.GetPolicyRequest result = new com.google.iam.v2.GetPolicyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.GetPolicyRequest) { + return mergeFrom((com.google.iam.v2.GetPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.GetPolicyRequest other) { + if (other == com.google.iam.v2.GetPolicyRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.GetPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.GetPolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the policy to retrieve. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the policy to retrieve. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the policy to retrieve. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the policy to retrieve. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the policy to retrieve. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * Use the URL-encoded full resource name, which means that the forward-slash
+     * character, `/`, must be written as `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.GetPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.GetPolicyRequest) + private static final com.google.iam.v2.GetPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.GetPolicyRequest(); + } + + public static com.google.iam.v2.GetPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.GetPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java new file mode 100644 index 00000000..6f293a32 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface GetPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.GetPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the policy to retrieve. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the policy to retrieve. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * Use the URL-encoded full resource name, which means that the forward-slash
+   * character, `/`, must be written as `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java new file mode 100644 index 00000000..fad84f5d --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java @@ -0,0 +1,1207 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * `ListApplicablePoliciesRequest` represents the Request message for the
+ * `ListApplicablePolicies` method. It provides the input for a filterable query
+ * of Policies that apply to a certain GCP Resource, specified by the field
+ * `attachment_point`, found on this message.
+ * Example:
+ * ```
+ * {
+ *    attachment_point:
+ *    'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901'
+ *    filter: 'kind:denyPolicies'
+ * }
+ * ```
+ * 
+ * + * Protobuf type {@code google.iam.v2.ListApplicablePoliciesRequest} + */ +public final class ListApplicablePoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.ListApplicablePoliciesRequest) + ListApplicablePoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApplicablePoliciesRequest.newBuilder() to construct. + private ListApplicablePoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApplicablePoliciesRequest() { + attachmentPoint_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApplicablePoliciesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListApplicablePoliciesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + attachmentPoint_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListApplicablePoliciesRequest.class, + com.google.iam.v2.ListApplicablePoliciesRequest.Builder.class); + } + + public static final int ATTACHMENT_POINT_FIELD_NUMBER = 1; + private volatile java.lang.Object attachmentPoint_; + /** + * + * + *
+   * Required. The Cloud resource at which the applicable policies are to be
+   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+   * name, which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+   * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attachmentPoint. + */ + @java.lang.Override + public java.lang.String getAttachmentPoint() { + java.lang.Object ref = attachmentPoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attachmentPoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Cloud resource at which the applicable policies are to be
+   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+   * name, which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+   * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attachmentPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttachmentPointBytes() { + java.lang.Object ref = attachmentPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attachmentPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Filtering currently only supports the kind of policies to return, and
+   * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+   * policy kinds may be added in the future without notice.
+   * Example value: β€œkind:denyPolicies”
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filtering currently only supports the kind of policies to return, and
+   * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+   * policy kinds may be added in the future without notice.
+   * Example value: β€œkind:denyPolicies”
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If present, then retrieve the batch of results following the results from
+   * the preceding call to this method.  `page_token` must be the value of
+   * `next_page_token`
+   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+   * from the previous response.  The values of other method parameters should
+   * be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If present, then retrieve the batch of results following the results from
+   * the preceding call to this method.  `page_token` must be the value of
+   * `next_page_token`
+   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+   * from the previous response.  The values of other method parameters should
+   * be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * Limit on the number of policies to include in the response.
+   * Further policies can subsequently be obtained by including the
+   * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
+   * in a subsequent request.
+   * The minimum is 25, and the maximum is 100.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attachmentPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attachmentPoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attachmentPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attachmentPoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.ListApplicablePoliciesRequest)) { + return super.equals(obj); + } + com.google.iam.v2.ListApplicablePoliciesRequest other = + (com.google.iam.v2.ListApplicablePoliciesRequest) obj; + + if (!getAttachmentPoint().equals(other.getAttachmentPoint())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTACHMENT_POINT_FIELD_NUMBER; + hash = (53 * hash) + getAttachmentPoint().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.ListApplicablePoliciesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * `ListApplicablePoliciesRequest` represents the Request message for the
+   * `ListApplicablePolicies` method. It provides the input for a filterable query
+   * of Policies that apply to a certain GCP Resource, specified by the field
+   * `attachment_point`, found on this message.
+   * Example:
+   * ```
+   * {
+   *    attachment_point:
+   *    'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901'
+   *    filter: 'kind:denyPolicies'
+   * }
+   * ```
+   * 
+ * + * Protobuf type {@code google.iam.v2.ListApplicablePoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.ListApplicablePoliciesRequest) + com.google.iam.v2.ListApplicablePoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListApplicablePoliciesRequest.class, + com.google.iam.v2.ListApplicablePoliciesRequest.Builder.class); + } + + // Construct using com.google.iam.v2.ListApplicablePoliciesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attachmentPoint_ = ""; + + filter_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesRequest getDefaultInstanceForType() { + return com.google.iam.v2.ListApplicablePoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesRequest build() { + com.google.iam.v2.ListApplicablePoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesRequest buildPartial() { + com.google.iam.v2.ListApplicablePoliciesRequest result = + new com.google.iam.v2.ListApplicablePoliciesRequest(this); + result.attachmentPoint_ = attachmentPoint_; + result.filter_ = filter_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.ListApplicablePoliciesRequest) { + return mergeFrom((com.google.iam.v2.ListApplicablePoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.ListApplicablePoliciesRequest other) { + if (other == com.google.iam.v2.ListApplicablePoliciesRequest.getDefaultInstance()) + return this; + if (!other.getAttachmentPoint().isEmpty()) { + attachmentPoint_ = other.attachmentPoint_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.ListApplicablePoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.ListApplicablePoliciesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attachmentPoint_ = ""; + /** + * + * + *
+     * Required. The Cloud resource at which the applicable policies are to be
+     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+     * name, which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+     * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attachmentPoint. + */ + public java.lang.String getAttachmentPoint() { + java.lang.Object ref = attachmentPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attachmentPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Cloud resource at which the applicable policies are to be
+     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+     * name, which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+     * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attachmentPoint. + */ + public com.google.protobuf.ByteString getAttachmentPointBytes() { + java.lang.Object ref = attachmentPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attachmentPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Cloud resource at which the applicable policies are to be
+     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+     * name, which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+     * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The attachmentPoint to set. + * @return This builder for chaining. + */ + public Builder setAttachmentPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attachmentPoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Cloud resource at which the applicable policies are to be
+     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+     * name, which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+     * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAttachmentPoint() { + + attachmentPoint_ = getDefaultInstance().getAttachmentPoint(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Cloud resource at which the applicable policies are to be
+     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+     * name, which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+     * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for attachmentPoint to set. + * @return This builder for chaining. + */ + public Builder setAttachmentPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attachmentPoint_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering currently only supports the kind of policies to return, and
+     * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+     * policy kinds may be added in the future without notice.
+     * Example value: β€œkind:denyPolicies”
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filtering currently only supports the kind of policies to return, and
+     * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+     * policy kinds may be added in the future without notice.
+     * Example value: β€œkind:denyPolicies”
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filtering currently only supports the kind of policies to return, and
+     * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+     * policy kinds may be added in the future without notice.
+     * Example value: β€œkind:denyPolicies”
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering currently only supports the kind of policies to return, and
+     * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+     * policy kinds may be added in the future without notice.
+     * Example value: β€œkind:denyPolicies”
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering currently only supports the kind of policies to return, and
+     * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+     * policy kinds may be added in the future without notice.
+     * Example value: β€œkind:denyPolicies”
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If present, then retrieve the batch of results following the results from
+     * the preceding call to this method.  `page_token` must be the value of
+     * `next_page_token`
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+     * from the previous response.  The values of other method parameters should
+     * be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If present, then retrieve the batch of results following the results from
+     * the preceding call to this method.  `page_token` must be the value of
+     * `next_page_token`
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+     * from the previous response.  The values of other method parameters should
+     * be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If present, then retrieve the batch of results following the results from
+     * the preceding call to this method.  `page_token` must be the value of
+     * `next_page_token`
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+     * from the previous response.  The values of other method parameters should
+     * be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If present, then retrieve the batch of results following the results from
+     * the preceding call to this method.  `page_token` must be the value of
+     * `next_page_token`
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+     * from the previous response.  The values of other method parameters should
+     * be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If present, then retrieve the batch of results following the results from
+     * the preceding call to this method.  `page_token` must be the value of
+     * `next_page_token`
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+     * from the previous response.  The values of other method parameters should
+     * be identical to those in the previous call.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Limit on the number of policies to include in the response.
+     * Further policies can subsequently be obtained by including the
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
+     * in a subsequent request.
+     * The minimum is 25, and the maximum is 100.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Limit on the number of policies to include in the response.
+     * Further policies can subsequently be obtained by including the
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
+     * in a subsequent request.
+     * The minimum is 25, and the maximum is 100.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Limit on the number of policies to include in the response.
+     * Further policies can subsequently be obtained by including the
+     * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
+     * in a subsequent request.
+     * The minimum is 25, and the maximum is 100.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.ListApplicablePoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.ListApplicablePoliciesRequest) + private static final com.google.iam.v2.ListApplicablePoliciesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.ListApplicablePoliciesRequest(); + } + + public static com.google.iam.v2.ListApplicablePoliciesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApplicablePoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListApplicablePoliciesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java new file mode 100644 index 00000000..b4b91808 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface ListApplicablePoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.ListApplicablePoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Cloud resource at which the applicable policies are to be
+   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+   * name, which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+   * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attachmentPoint. + */ + java.lang.String getAttachmentPoint(); + /** + * + * + *
+   * Required. The Cloud resource at which the applicable policies are to be
+   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
+   * name, which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
+   * 
+ * + * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attachmentPoint. + */ + com.google.protobuf.ByteString getAttachmentPointBytes(); + + /** + * + * + *
+   * Filtering currently only supports the kind of policies to return, and
+   * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+   * policy kinds may be added in the future without notice.
+   * Example value: β€œkind:denyPolicies”
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering currently only supports the kind of policies to return, and
+   * must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”.  New
+   * policy kinds may be added in the future without notice.
+   * Example value: β€œkind:denyPolicies”
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * If present, then retrieve the batch of results following the results from
+   * the preceding call to this method.  `page_token` must be the value of
+   * `next_page_token`
+   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+   * from the previous response.  The values of other method parameters should
+   * be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If present, then retrieve the batch of results following the results from
+   * the preceding call to this method.  `page_token` must be the value of
+   * `next_page_token`
+   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
+   * from the previous response.  The values of other method parameters should
+   * be identical to those in the previous call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Limit on the number of policies to include in the response.
+   * Further policies can subsequently be obtained by including the
+   * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
+   * in a subsequent request.
+   * The minimum is 25, and the maximum is 100.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java new file mode 100644 index 00000000..6c31b640 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java @@ -0,0 +1,1503 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Response message for [ListApplicablePolicies][] method.
+ * 
+ * + * Protobuf type {@code google.iam.v2.ListApplicablePoliciesResponse} + */ +public final class ListApplicablePoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.ListApplicablePoliciesResponse) + ListApplicablePoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListApplicablePoliciesResponse.newBuilder() to construct. + private ListApplicablePoliciesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListApplicablePoliciesResponse() { + policies_ = java.util.Collections.emptyList(); + inaccessible_ = com.google.protobuf.LazyStringArrayList.EMPTY; + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListApplicablePoliciesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListApplicablePoliciesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + policies_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + policies_.add( + input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + inaccessible_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + inaccessible_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + policies_ = java.util.Collections.unmodifiableList(policies_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + inaccessible_ = inaccessible_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListApplicablePoliciesResponse.class, + com.google.iam.v2.ListApplicablePoliciesResponse.Builder.class); + } + + public static final int POLICIES_FIELD_NUMBER = 1; + private java.util.List policies_; + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public java.util.List getPoliciesList() { + return policies_; + } + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public java.util.List getPoliciesOrBuilderList() { + return policies_; + } + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public int getPoliciesCount() { + return policies_.size(); + } + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public com.google.iam.v2.Policy getPolicies(int index) { + return policies_.get(index); + } + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { + return policies_.get(index); + } + + public static final int INACCESSIBLE_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList inaccessible_; + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @return A list containing the inaccessible. + */ + public com.google.protobuf.ProtocolStringList getInaccessibleList() { + return inaccessible_; + } + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @return The count of inaccessible. + */ + public int getInaccessibleCount() { + return inaccessible_.size(); + } + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index of the element to return. + * @return The inaccessible at the given index. + */ + public java.lang.String getInaccessible(int index) { + return inaccessible_.get(index); + } + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index of the value to return. + * @return The bytes of the inaccessible at the given index. + */ + public com.google.protobuf.ByteString getInaccessibleBytes(int index) { + return inaccessible_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A page token that can be used in a
+   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+   * to retrieve the next page. If this field is blank, there are no additional
+   * pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token that can be used in a
+   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+   * to retrieve the next page. If this field is blank, there are no additional
+   * pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < policies_.size(); i++) { + output.writeMessage(1, policies_.get(i)); + } + for (int i = 0; i < inaccessible_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, inaccessible_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < policies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policies_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < inaccessible_.size(); i++) { + dataSize += computeStringSizeNoTag(inaccessible_.getRaw(i)); + } + size += dataSize; + size += 1 * getInaccessibleList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.ListApplicablePoliciesResponse)) { + return super.equals(obj); + } + com.google.iam.v2.ListApplicablePoliciesResponse other = + (com.google.iam.v2.ListApplicablePoliciesResponse) obj; + + if (!getPoliciesList().equals(other.getPoliciesList())) return false; + if (!getInaccessibleList().equals(other.getInaccessibleList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPoliciesCount() > 0) { + hash = (37 * hash) + POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getPoliciesList().hashCode(); + } + if (getInaccessibleCount() > 0) { + hash = (37 * hash) + INACCESSIBLE_FIELD_NUMBER; + hash = (53 * hash) + getInaccessibleList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.ListApplicablePoliciesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [ListApplicablePolicies][] method.
+   * 
+ * + * Protobuf type {@code google.iam.v2.ListApplicablePoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.ListApplicablePoliciesResponse) + com.google.iam.v2.ListApplicablePoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListApplicablePoliciesResponse.class, + com.google.iam.v2.ListApplicablePoliciesResponse.Builder.class); + } + + // Construct using com.google.iam.v2.ListApplicablePoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (policiesBuilder_ == null) { + policies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + policiesBuilder_.clear(); + } + inaccessible_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesResponse getDefaultInstanceForType() { + return com.google.iam.v2.ListApplicablePoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesResponse build() { + com.google.iam.v2.ListApplicablePoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesResponse buildPartial() { + com.google.iam.v2.ListApplicablePoliciesResponse result = + new com.google.iam.v2.ListApplicablePoliciesResponse(this); + int from_bitField0_ = bitField0_; + if (policiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policies_ = java.util.Collections.unmodifiableList(policies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policies_ = policies_; + } else { + result.policies_ = policiesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + inaccessible_ = inaccessible_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.inaccessible_ = inaccessible_; + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.ListApplicablePoliciesResponse) { + return mergeFrom((com.google.iam.v2.ListApplicablePoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.ListApplicablePoliciesResponse other) { + if (other == com.google.iam.v2.ListApplicablePoliciesResponse.getDefaultInstance()) + return this; + if (policiesBuilder_ == null) { + if (!other.policies_.isEmpty()) { + if (policies_.isEmpty()) { + policies_ = other.policies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePoliciesIsMutable(); + policies_.addAll(other.policies_); + } + onChanged(); + } + } else { + if (!other.policies_.isEmpty()) { + if (policiesBuilder_.isEmpty()) { + policiesBuilder_.dispose(); + policiesBuilder_ = null; + policies_ = other.policies_; + bitField0_ = (bitField0_ & ~0x00000001); + policiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPoliciesFieldBuilder() + : null; + } else { + policiesBuilder_.addAllMessages(other.policies_); + } + } + } + if (!other.inaccessible_.isEmpty()) { + if (inaccessible_.isEmpty()) { + inaccessible_ = other.inaccessible_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInaccessibleIsMutable(); + inaccessible_.addAll(other.inaccessible_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.ListApplicablePoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.ListApplicablePoliciesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List policies_ = java.util.Collections.emptyList(); + + private void ensurePoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policies_ = new java.util.ArrayList(policies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + policiesBuilder_; + + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public java.util.List getPoliciesList() { + if (policiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(policies_); + } else { + return policiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public int getPoliciesCount() { + if (policiesBuilder_ == null) { + return policies_.size(); + } else { + return policiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy getPolicies(int index) { + if (policiesBuilder_ == null) { + return policies_.get(index); + } else { + return policiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder setPolicies(int index, com.google.iam.v2.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.set(index, value); + onChanged(); + } else { + policiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder setPolicies(int index, com.google.iam.v2.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.set(index, builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(com.google.iam.v2.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.add(value); + onChanged(); + } else { + policiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(int index, com.google.iam.v2.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.add(index, value); + onChanged(); + } else { + policiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(com.google.iam.v2.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(int index, com.google.iam.v2.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(index, builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addAllPolicies(java.lang.Iterable values) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policies_); + onChanged(); + } else { + policiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder clearPolicies() { + if (policiesBuilder_ == null) { + policies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder removePolicies(int index) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.remove(index); + onChanged(); + } else { + policiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy.Builder getPoliciesBuilder(int index) { + return getPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { + if (policiesBuilder_ == null) { + return policies_.get(index); + } else { + return policiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public java.util.List getPoliciesOrBuilderList() { + if (policiesBuilder_ != null) { + return policiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policies_); + } + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy.Builder addPoliciesBuilder() { + return getPoliciesFieldBuilder().addBuilder(com.google.iam.v2.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy.Builder addPoliciesBuilder(int index) { + return getPoliciesFieldBuilder() + .addBuilder(index, com.google.iam.v2.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * Ordered list starting from the resource on which this API was called
+     * then proceeding up the hierarchy. Policies for the same attachment point
+     * will be grouped, but no further ordering is guaranteed.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public java.util.List getPoliciesBuilderList() { + return getPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + getPoliciesFieldBuilder() { + if (policiesBuilder_ == null) { + policiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder>( + policies_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + policies_ = null; + } + return policiesBuilder_; + } + + private com.google.protobuf.LazyStringList inaccessible_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInaccessibleIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + inaccessible_ = new com.google.protobuf.LazyStringArrayList(inaccessible_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @return A list containing the inaccessible. + */ + public com.google.protobuf.ProtocolStringList getInaccessibleList() { + return inaccessible_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @return The count of inaccessible. + */ + public int getInaccessibleCount() { + return inaccessible_.size(); + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index of the element to return. + * @return The inaccessible at the given index. + */ + public java.lang.String getInaccessible(int index) { + return inaccessible_.get(index); + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index of the value to return. + * @return The bytes of the inaccessible at the given index. + */ + public com.google.protobuf.ByteString getInaccessibleBytes(int index) { + return inaccessible_.getByteString(index); + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index to set the value at. + * @param value The inaccessible to set. + * @return This builder for chaining. + */ + public Builder setInaccessible(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInaccessibleIsMutable(); + inaccessible_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @param value The inaccessible to add. + * @return This builder for chaining. + */ + public Builder addInaccessible(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInaccessibleIsMutable(); + inaccessible_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @param values The inaccessible to add. + * @return This builder for chaining. + */ + public Builder addAllInaccessible(java.lang.Iterable values) { + ensureInaccessibleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inaccessible_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @return This builder for chaining. + */ + public Builder clearInaccessible() { + inaccessible_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of resources that the caller does not have permission to retrieve.
+     * List or Get can be used to get detailed error messages.
+     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+     * List: `policies/{attachment-point}/denypolicies`
+     * 
+ * + * repeated string inaccessible = 2; + * + * @param value The bytes of the inaccessible to add. + * @return This builder for chaining. + */ + public Builder addInaccessibleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInaccessibleIsMutable(); + inaccessible_.add(value); + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token that can be used in a
+     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+     * to retrieve the next page. If this field is blank, there are no additional
+     * pages.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token that can be used in a
+     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+     * to retrieve the next page. If this field is blank, there are no additional
+     * pages.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token that can be used in a
+     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+     * to retrieve the next page. If this field is blank, there are no additional
+     * pages.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that can be used in a
+     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+     * to retrieve the next page. If this field is blank, there are no additional
+     * pages.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that can be used in a
+     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+     * to retrieve the next page. If this field is blank, there are no additional
+     * pages.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.ListApplicablePoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.ListApplicablePoliciesResponse) + private static final com.google.iam.v2.ListApplicablePoliciesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.ListApplicablePoliciesResponse(); + } + + public static com.google.iam.v2.ListApplicablePoliciesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListApplicablePoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListApplicablePoliciesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.ListApplicablePoliciesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java new file mode 100644 index 00000000..f83bbeda --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface ListApplicablePoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.ListApplicablePoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + java.util.List getPoliciesList(); + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + com.google.iam.v2.Policy getPolicies(int index); + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + int getPoliciesCount(); + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + java.util.List getPoliciesOrBuilderList(); + /** + * + * + *
+   * Ordered list starting from the resource on which this API was called
+   * then proceeding up the hierarchy. Policies for the same attachment point
+   * will be grouped, but no further ordering is guaranteed.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index); + + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @return A list containing the inaccessible. + */ + java.util.List getInaccessibleList(); + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @return The count of inaccessible. + */ + int getInaccessibleCount(); + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index of the element to return. + * @return The inaccessible at the given index. + */ + java.lang.String getInaccessible(int index); + /** + * + * + *
+   * A list of resources that the caller does not have permission to retrieve.
+   * List or Get can be used to get detailed error messages.
+   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
+   * List: `policies/{attachment-point}/denypolicies`
+   * 
+ * + * repeated string inaccessible = 2; + * + * @param index The index of the value to return. + * @return The bytes of the inaccessible at the given index. + */ + com.google.protobuf.ByteString getInaccessibleBytes(int index); + + /** + * + * + *
+   * A page token that can be used in a
+   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+   * to retrieve the next page. If this field is blank, there are no additional
+   * pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token that can be used in a
+   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
+   * to retrieve the next page. If this field is blank, there are no additional
+   * pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java new file mode 100644 index 00000000..5665c5b7 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java @@ -0,0 +1,970 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Request message for `ListPolicies`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.ListPoliciesRequest} + */ +public final class ListPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.ListPoliciesRequest) + ListPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPoliciesRequest.newBuilder() to construct. + private ListPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPoliciesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPoliciesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListPoliciesRequest.class, + com.google.iam.v2.ListPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of policies to return. IAM ignores this value and uses
+   * the value 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token received in a
+   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+   * token to retrieve the next page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token received in a
+   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+   * token to retrieve the next page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.ListPoliciesRequest)) { + return super.equals(obj); + } + com.google.iam.v2.ListPoliciesRequest other = (com.google.iam.v2.ListPoliciesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListPoliciesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.ListPoliciesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `ListPolicies`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.ListPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.ListPoliciesRequest) + com.google.iam.v2.ListPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListPoliciesRequest.class, + com.google.iam.v2.ListPoliciesRequest.Builder.class); + } + + // Construct using com.google.iam.v2.ListPoliciesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesRequest getDefaultInstanceForType() { + return com.google.iam.v2.ListPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesRequest build() { + com.google.iam.v2.ListPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesRequest buildPartial() { + com.google.iam.v2.ListPoliciesRequest result = + new com.google.iam.v2.ListPoliciesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.ListPoliciesRequest) { + return mergeFrom((com.google.iam.v2.ListPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.ListPoliciesRequest other) { + if (other == com.google.iam.v2.ListPoliciesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.ListPoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.ListPoliciesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource that the policy is attached to, along with the kind
+     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, you can use the alphanumeric or the numeric ID.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of policies to return. IAM ignores this value and uses
+     * the value 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of policies to return. IAM ignores this value and uses
+     * the value 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of policies to return. IAM ignores this value and uses
+     * the value 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token received in a
+     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+     * token to retrieve the next page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token received in a
+     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+     * token to retrieve the next page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token received in a
+     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+     * token to retrieve the next page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token received in a
+     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+     * token to retrieve the next page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token received in a
+     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+     * token to retrieve the next page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.ListPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.ListPoliciesRequest) + private static final com.google.iam.v2.ListPoliciesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.ListPoliciesRequest(); + } + + public static com.google.iam.v2.ListPoliciesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPoliciesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java new file mode 100644 index 00000000..5ccf0c27 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface ListPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.ListPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource that the policy is attached to, along with the kind
+   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, you can use the alphanumeric or the numeric ID.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of policies to return. IAM ignores this value and uses
+   * the value 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token received in a
+   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+   * token to retrieve the next page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token received in a
+   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
+   * token to retrieve the next page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java new file mode 100644 index 00000000..fa2820bd --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Response message for `ListPolicies`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.ListPoliciesResponse} + */ +public final class ListPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.ListPoliciesResponse) + ListPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPoliciesResponse.newBuilder() to construct. + private ListPoliciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPoliciesResponse() { + policies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPoliciesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPoliciesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + policies_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + policies_.add( + input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + policies_ = java.util.Collections.unmodifiableList(policies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListPoliciesResponse.class, + com.google.iam.v2.ListPoliciesResponse.Builder.class); + } + + public static final int POLICIES_FIELD_NUMBER = 1; + private java.util.List policies_; + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public java.util.List getPoliciesList() { + return policies_; + } + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public java.util.List getPoliciesOrBuilderList() { + return policies_; + } + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public int getPoliciesCount() { + return policies_.size(); + } + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public com.google.iam.v2.Policy getPolicies(int index) { + return policies_.get(index); + } + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + @java.lang.Override + public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { + return policies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A page token that you can use in a
+   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * next page. If this field is omitted, there are no additional pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token that you can use in a
+   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * next page. If this field is omitted, there are no additional pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < policies_.size(); i++) { + output.writeMessage(1, policies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < policies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.ListPoliciesResponse)) { + return super.equals(obj); + } + com.google.iam.v2.ListPoliciesResponse other = (com.google.iam.v2.ListPoliciesResponse) obj; + + if (!getPoliciesList().equals(other.getPoliciesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPoliciesCount() > 0) { + hash = (37 * hash) + POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getPoliciesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListPoliciesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.ListPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.ListPoliciesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for `ListPolicies`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.ListPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.ListPoliciesResponse) + com.google.iam.v2.ListPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.ListPoliciesResponse.class, + com.google.iam.v2.ListPoliciesResponse.Builder.class); + } + + // Construct using com.google.iam.v2.ListPoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (policiesBuilder_ == null) { + policies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + policiesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_ListPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesResponse getDefaultInstanceForType() { + return com.google.iam.v2.ListPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesResponse build() { + com.google.iam.v2.ListPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesResponse buildPartial() { + com.google.iam.v2.ListPoliciesResponse result = + new com.google.iam.v2.ListPoliciesResponse(this); + int from_bitField0_ = bitField0_; + if (policiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policies_ = java.util.Collections.unmodifiableList(policies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policies_ = policies_; + } else { + result.policies_ = policiesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.ListPoliciesResponse) { + return mergeFrom((com.google.iam.v2.ListPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.ListPoliciesResponse other) { + if (other == com.google.iam.v2.ListPoliciesResponse.getDefaultInstance()) return this; + if (policiesBuilder_ == null) { + if (!other.policies_.isEmpty()) { + if (policies_.isEmpty()) { + policies_ = other.policies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePoliciesIsMutable(); + policies_.addAll(other.policies_); + } + onChanged(); + } + } else { + if (!other.policies_.isEmpty()) { + if (policiesBuilder_.isEmpty()) { + policiesBuilder_.dispose(); + policiesBuilder_ = null; + policies_ = other.policies_; + bitField0_ = (bitField0_ & ~0x00000001); + policiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPoliciesFieldBuilder() + : null; + } else { + policiesBuilder_.addAllMessages(other.policies_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.ListPoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.ListPoliciesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List policies_ = java.util.Collections.emptyList(); + + private void ensurePoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policies_ = new java.util.ArrayList(policies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + policiesBuilder_; + + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public java.util.List getPoliciesList() { + if (policiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(policies_); + } else { + return policiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public int getPoliciesCount() { + if (policiesBuilder_ == null) { + return policies_.size(); + } else { + return policiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy getPolicies(int index) { + if (policiesBuilder_ == null) { + return policies_.get(index); + } else { + return policiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder setPolicies(int index, com.google.iam.v2.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.set(index, value); + onChanged(); + } else { + policiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder setPolicies(int index, com.google.iam.v2.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.set(index, builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(com.google.iam.v2.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.add(value); + onChanged(); + } else { + policiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(int index, com.google.iam.v2.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.add(index, value); + onChanged(); + } else { + policiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(com.google.iam.v2.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addPolicies(int index, com.google.iam.v2.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(index, builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder addAllPolicies(java.lang.Iterable values) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policies_); + onChanged(); + } else { + policiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder clearPolicies() { + if (policiesBuilder_ == null) { + policies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public Builder removePolicies(int index) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.remove(index); + onChanged(); + } else { + policiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy.Builder getPoliciesBuilder(int index) { + return getPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { + if (policiesBuilder_ == null) { + return policies_.get(index); + } else { + return policiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public java.util.List getPoliciesOrBuilderList() { + if (policiesBuilder_ != null) { + return policiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policies_); + } + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy.Builder addPoliciesBuilder() { + return getPoliciesFieldBuilder().addBuilder(com.google.iam.v2.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public com.google.iam.v2.Policy.Builder addPoliciesBuilder(int index) { + return getPoliciesFieldBuilder() + .addBuilder(index, com.google.iam.v2.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * Metadata for the policies that are attached to the resource.
+     * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + public java.util.List getPoliciesBuilderList() { + return getPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + getPoliciesFieldBuilder() { + if (policiesBuilder_ == null) { + policiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder>( + policies_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + policies_ = null; + } + return policiesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token that you can use in a
+     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * next page. If this field is omitted, there are no additional pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token that you can use in a
+     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * next page. If this field is omitted, there are no additional pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token that you can use in a
+     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * next page. If this field is omitted, there are no additional pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that you can use in a
+     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * next page. If this field is omitted, there are no additional pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that you can use in a
+     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * next page. If this field is omitted, there are no additional pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.ListPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.ListPoliciesResponse) + private static final com.google.iam.v2.ListPoliciesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.ListPoliciesResponse(); + } + + public static com.google.iam.v2.ListPoliciesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPoliciesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.ListPoliciesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java new file mode 100644 index 00000000..54a77f75 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface ListPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.ListPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + java.util.List getPoliciesList(); + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + com.google.iam.v2.Policy getPolicies(int index); + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + int getPoliciesCount(); + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + java.util.List getPoliciesOrBuilderList(); + /** + * + * + *
+   * Metadata for the policies that are attached to the resource.
+   * 
+ * + * repeated .google.iam.v2.Policy policies = 1; + */ + com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index); + + /** + * + * + *
+   * A page token that you can use in a
+   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * next page. If this field is omitted, there are no additional pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token that you can use in a
+   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * next page. If this field is omitted, there are no additional pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java new file mode 100644 index 00000000..2de2078e --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java @@ -0,0 +1,3369 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Data for an IAM policy.
+ * 
+ * + * Protobuf type {@code google.iam.v2.Policy} + */ +public final class Policy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.Policy) + PolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Policy.newBuilder() to construct. + private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Policy() { + name_ = ""; + uid_ = ""; + kind_ = ""; + displayName_ = ""; + etag_ = ""; + rules_ = java.util.Collections.emptyList(); + managingAuthority_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Policy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Policy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + uid_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + kind_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + annotations_ = + com.google.protobuf.MapField.newMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + annotations_.getMutableMap().put(annotations__.getKey(), annotations__.getValue()); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (deleteTime_ != null) { + subBuilder = deleteTime_.toBuilder(); + } + deleteTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deleteTime_); + deleteTime_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + rules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + rules_.add( + input.readMessage(com.google.iam.v2.PolicyRule.parser(), extensionRegistry)); + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + managingAuthority_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.Policy.class, com.google.iam.v2.Policy.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The resource name of the `Policy`, which must be unique. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, requests can use the alphanumeric or the numeric ID.
+   * Responses always contain the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The resource name of the `Policy`, which must be unique. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, requests can use the alphanumeric or the numeric ID.
+   * Responses always contain the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 2; + private volatile java.lang.Object uid_; + /** + * + * + *
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+   * when the `Policy` is created.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+   * when the `Policy` is created.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 3; + private volatile java.lang.Object kind_; + /** + * + * + *
+   * Output only. The kind of the `Policy`. Always contains the value
+   * `DenyPolicy`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The kind of the `Policy`. Always contains the value
+   * `DenyPolicy`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * A user-specified description of the `Policy`. This value can be up to 63
+   * characters.
+   * 
+ * + * string display_name = 4; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * A user-specified description of the `Policy`. This value can be up to 63
+   * characters.
+   * 
+ * + * string display_name = 4; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ETAG_FIELD_NUMBER = 6; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * An opaque tag that identifies the current version of the `Policy`. IAM uses
+   * this value to help manage concurrent updates, so they do not cause one
+   * update to be overwritten by another.
+   * If this field is present in a [CreatePolicy][] request, the value is
+   * ignored.
+   * 
+ * + * string etag = 6; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * An opaque tag that identifies the current version of the `Policy`. IAM uses
+   * this value to help manage concurrent updates, so they do not cause one
+   * update to be overwritten by another.
+   * If this field is present in a [CreatePolicy][] request, the value is
+   * ignored.
+   * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time when the `Policy` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the `Policy` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time when the `Policy` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the `Policy` was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the `Policy` was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The time when the `Policy` was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int DELETE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is
+   * not deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is
+   * not deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is
+   * not deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return getDeleteTime(); + } + + public static final int RULES_FIELD_NUMBER = 10; + private java.util.List rules_; + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + @java.lang.Override + public java.util.List getRulesOrBuilderList() { + return rules_; + } + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + @java.lang.Override + public com.google.iam.v2.PolicyRule getRules(int index) { + return rules_.get(index); + } + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + @java.lang.Override + public com.google.iam.v2.PolicyRuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + public static final int MANAGING_AUTHORITY_FIELD_NUMBER = 11; + private volatile java.lang.Object managingAuthority_; + /** + * + * + *
+   * Immutable. Specifies that this policy is managed by an authority and can
+   * only be modified by that authority. Usage is restricted.
+   * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The managingAuthority. + */ + @java.lang.Override + public java.lang.String getManagingAuthority() { + java.lang.Object ref = managingAuthority_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + managingAuthority_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Specifies that this policy is managed by an authority and can
+   * only be modified by that authority. Usage is restricted.
+   * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for managingAuthority. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManagingAuthorityBytes() { + java.lang.Object ref = managingAuthority_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + managingAuthority_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kind_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, displayName_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, etag_); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(8, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(9, getDeleteTime()); + } + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(10, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(managingAuthority_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, managingAuthority_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kind_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, displayName_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, etag_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getDeleteTime()); + } + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(managingAuthority_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, managingAuthority_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.Policy)) { + return super.equals(obj); + } + com.google.iam.v2.Policy other = (com.google.iam.v2.Policy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getKind().equals(other.getKind())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getManagingAuthority().equals(other.getManagingAuthority())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (37 * hash) + MANAGING_AUTHORITY_FIELD_NUMBER; + hash = (53 * hash) + getManagingAuthority().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.Policy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.Policy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.Policy parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.Policy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.Policy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.Policy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.Policy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.Policy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.Policy parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.Policy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.Policy parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.Policy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.Policy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Data for an IAM policy.
+   * 
+ * + * Protobuf type {@code google.iam.v2.Policy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.Policy) + com.google.iam.v2.PolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.Policy.class, com.google.iam.v2.Policy.Builder.class); + } + + // Construct using com.google.iam.v2.Policy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRulesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + uid_ = ""; + + kind_ = ""; + + displayName_ = ""; + + internalGetMutableAnnotations().clear(); + etag_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + rulesBuilder_.clear(); + } + managingAuthority_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.Policy getDefaultInstanceForType() { + return com.google.iam.v2.Policy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.Policy build() { + com.google.iam.v2.Policy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.Policy buildPartial() { + com.google.iam.v2.Policy result = new com.google.iam.v2.Policy(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.uid_ = uid_; + result.kind_ = kind_; + result.displayName_ = displayName_; + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + result.etag_ = etag_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (deleteTimeBuilder_ == null) { + result.deleteTime_ = deleteTime_; + } else { + result.deleteTime_ = deleteTimeBuilder_.build(); + } + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + result.managingAuthority_ = managingAuthority_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.Policy) { + return mergeFrom((com.google.iam.v2.Policy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.Policy other) { + if (other == com.google.iam.v2.Policy.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000002); + rulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + if (!other.getManagingAuthority().isEmpty()) { + managingAuthority_ = other.managingAuthority_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.Policy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.Policy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The resource name of the `Policy`, which must be unique. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, requests can use the alphanumeric or the numeric ID.
+     * Responses always contain the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name of the `Policy`, which must be unique. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, requests can use the alphanumeric or the numeric ID.
+     * Responses always contain the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name of the `Policy`, which must be unique. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, requests can use the alphanumeric or the numeric ID.
+     * Responses always contain the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the `Policy`, which must be unique. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, requests can use the alphanumeric or the numeric ID.
+     * Responses always contain the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the `Policy`, which must be unique. Format:
+     * `policies/{attachment_point}/denypolicies/{policy_id}`
+     * The attachment point is identified by its URL-encoded full resource name,
+     * which means that the forward-slash character, `/`, must be written as
+     * `%2F`. For example,
+     * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+     * For organizations and folders, use the numeric ID in the full resource
+     * name. For projects, requests can use the alphanumeric or the numeric ID.
+     * Responses always contain the numeric ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+     * when the `Policy` is created.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+     * when the `Policy` is created.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+     * when the `Policy` is created.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+     * when the `Policy` is created.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + + uid_ = getDefaultInstance().getUid(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+     * when the `Policy` is created.
+     * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uid_ = value; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + /** + * + * + *
+     * Output only. The kind of the `Policy`. Always contains the value
+     * `DenyPolicy`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The kind of the `Policy`. Always contains the value
+     * `DenyPolicy`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The kind of the `Policy`. Always contains the value
+     * `DenyPolicy`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The kind of the `Policy`. Always contains the value
+     * `DenyPolicy`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + + kind_ = getDefaultInstance().getKind(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The kind of the `Policy`. Always contains the value
+     * `DenyPolicy`.
+     * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kind_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * A user-specified description of the `Policy`. This value can be up to 63
+     * characters.
+     * 
+ * + * string display_name = 4; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A user-specified description of the `Policy`. This value can be up to 63
+     * characters.
+     * 
+ * + * string display_name = 4; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A user-specified description of the `Policy`. This value can be up to 63
+     * characters.
+     * 
+ * + * string display_name = 4; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A user-specified description of the `Policy`. This value can be up to 63
+     * characters.
+     * 
+ * + * string display_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A user-specified description of the `Policy`. This value can be up to 63
+     * characters.
+     * 
+ * + * string display_name = 4; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + onChanged(); + ; + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAnnotations().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A key-value map to store arbitrary metadata for the `Policy`. Keys
+     * can be up to 63 characters. Values can be up to 255 characters.
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * An opaque tag that identifies the current version of the `Policy`. IAM uses
+     * this value to help manage concurrent updates, so they do not cause one
+     * update to be overwritten by another.
+     * If this field is present in a [CreatePolicy][] request, the value is
+     * ignored.
+     * 
+ * + * string etag = 6; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An opaque tag that identifies the current version of the `Policy`. IAM uses
+     * this value to help manage concurrent updates, so they do not cause one
+     * update to be overwritten by another.
+     * If this field is present in a [CreatePolicy][] request, the value is
+     * ignored.
+     * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An opaque tag that identifies the current version of the `Policy`. IAM uses
+     * this value to help manage concurrent updates, so they do not cause one
+     * update to be overwritten by another.
+     * If this field is present in a [CreatePolicy][] request, the value is
+     * ignored.
+     * 
+ * + * string etag = 6; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An opaque tag that identifies the current version of the `Policy`. IAM uses
+     * this value to help manage concurrent updates, so they do not cause one
+     * update to be overwritten by another.
+     * If this field is present in a [CreatePolicy][] request, the value is
+     * ignored.
+     * 
+ * + * string etag = 6; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * An opaque tag that identifies the current version of the `Policy`. IAM uses
+     * this value to help manage concurrent updates, so they do not cause one
+     * update to be overwritten by another.
+     * If this field is present in a [CreatePolicy][] request, the value is
+     * ignored.
+     * 
+ * + * string etag = 6; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time when the `Policy` was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The time when the `Policy` was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return deleteTimeBuilder_ != null || deleteTime_ != null; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + onChanged(); + } else { + deleteTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + onChanged(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (deleteTime_ != null) { + deleteTime_ = + com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + } else { + deleteTime_ = value; + } + onChanged(); + } else { + deleteTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + onChanged(); + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is
+     * not deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.util.List rules_ = java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.PolicyRule, + com.google.iam.v2.PolicyRule.Builder, + com.google.iam.v2.PolicyRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public com.google.iam.v2.PolicyRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder setRules(int index, com.google.iam.v2.PolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder setRules(int index, com.google.iam.v2.PolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder addRules(com.google.iam.v2.PolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder addRules(int index, com.google.iam.v2.PolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder addRules(com.google.iam.v2.PolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder addRules(int index, com.google.iam.v2.PolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder addAllRules(java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public com.google.iam.v2.PolicyRule.Builder getRulesBuilder(int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public com.google.iam.v2.PolicyRuleOrBuilder getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public java.util.List getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public com.google.iam.v2.PolicyRule.Builder addRulesBuilder() { + return getRulesFieldBuilder().addBuilder(com.google.iam.v2.PolicyRule.getDefaultInstance()); + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public com.google.iam.v2.PolicyRule.Builder addRulesBuilder(int index) { + return getRulesFieldBuilder() + .addBuilder(index, com.google.iam.v2.PolicyRule.getDefaultInstance()); + } + /** + * + * + *
+     * A list of rules that specify the behavior of the `Policy`. All of the rules
+     * should be of the `kind` specified in the `Policy`.
+     * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + public java.util.List getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.PolicyRule, + com.google.iam.v2.PolicyRule.Builder, + com.google.iam.v2.PolicyRuleOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.iam.v2.PolicyRule, + com.google.iam.v2.PolicyRule.Builder, + com.google.iam.v2.PolicyRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + private java.lang.Object managingAuthority_ = ""; + /** + * + * + *
+     * Immutable. Specifies that this policy is managed by an authority and can
+     * only be modified by that authority. Usage is restricted.
+     * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The managingAuthority. + */ + public java.lang.String getManagingAuthority() { + java.lang.Object ref = managingAuthority_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + managingAuthority_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Specifies that this policy is managed by an authority and can
+     * only be modified by that authority. Usage is restricted.
+     * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for managingAuthority. + */ + public com.google.protobuf.ByteString getManagingAuthorityBytes() { + java.lang.Object ref = managingAuthority_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + managingAuthority_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Specifies that this policy is managed by an authority and can
+     * only be modified by that authority. Usage is restricted.
+     * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The managingAuthority to set. + * @return This builder for chaining. + */ + public Builder setManagingAuthority(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + managingAuthority_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Specifies that this policy is managed by an authority and can
+     * only be modified by that authority. Usage is restricted.
+     * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearManagingAuthority() { + + managingAuthority_ = getDefaultInstance().getManagingAuthority(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Specifies that this policy is managed by an authority and can
+     * only be modified by that authority. Usage is restricted.
+     * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for managingAuthority to set. + * @return This builder for chaining. + */ + public Builder setManagingAuthorityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + managingAuthority_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.Policy) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.Policy) + private static final com.google.iam.v2.Policy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.Policy(); + } + + public static com.google.iam.v2.Policy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Policy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Policy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.Policy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java new file mode 100644 index 00000000..3f3b95fc --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java @@ -0,0 +1,728 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Metadata for long-running `Policy` operations.
+ * 
+ * + * Protobuf type {@code google.iam.v2.PolicyOperationMetadata} + */ +public final class PolicyOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.PolicyOperationMetadata) + PolicyOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyOperationMetadata.newBuilder() to construct. + private PolicyOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PolicyOperationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PolicyOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PolicyOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.PolicyOperationMetadata.class, + com.google.iam.v2.PolicyOperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Timestamp when the `google.longrunning.Operation` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Timestamp when the `google.longrunning.Operation` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Timestamp when the `google.longrunning.Operation` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.PolicyOperationMetadata)) { + return super.equals(obj); + } + com.google.iam.v2.PolicyOperationMetadata other = + (com.google.iam.v2.PolicyOperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.PolicyOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.PolicyOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata for long-running `Policy` operations.
+   * 
+ * + * Protobuf type {@code google.iam.v2.PolicyOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.PolicyOperationMetadata) + com.google.iam.v2.PolicyOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.PolicyOperationMetadata.class, + com.google.iam.v2.PolicyOperationMetadata.Builder.class); + } + + // Construct using com.google.iam.v2.PolicyOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.PolicyOperationMetadata getDefaultInstanceForType() { + return com.google.iam.v2.PolicyOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.PolicyOperationMetadata build() { + com.google.iam.v2.PolicyOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.PolicyOperationMetadata buildPartial() { + com.google.iam.v2.PolicyOperationMetadata result = + new com.google.iam.v2.PolicyOperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.PolicyOperationMetadata) { + return mergeFrom((com.google.iam.v2.PolicyOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.PolicyOperationMetadata other) { + if (other == com.google.iam.v2.PolicyOperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.PolicyOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.PolicyOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Timestamp when the `google.longrunning.Operation` was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.PolicyOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.PolicyOperationMetadata) + private static final com.google.iam.v2.PolicyOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.PolicyOperationMetadata(); + } + + public static com.google.iam.v2.PolicyOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyOperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.PolicyOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java new file mode 100644 index 00000000..902e8200 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface PolicyOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.PolicyOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Timestamp when the `google.longrunning.Operation` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Timestamp when the `google.longrunning.Operation` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Timestamp when the `google.longrunning.Operation` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java new file mode 100644 index 00000000..276617f9 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java @@ -0,0 +1,444 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface PolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.Policy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The resource name of the `Policy`, which must be unique. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, requests can use the alphanumeric or the numeric ID.
+   * Responses always contain the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The resource name of the `Policy`, which must be unique. Format:
+   * `policies/{attachment_point}/denypolicies/{policy_id}`
+   * The attachment point is identified by its URL-encoded full resource name,
+   * which means that the forward-slash character, `/`, must be written as
+   * `%2F`. For example,
+   * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
+   * For organizations and folders, use the numeric ID in the full resource
+   * name. For projects, requests can use the alphanumeric or the numeric ID.
+   * Responses always contain the numeric ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+   * when the `Policy` is created.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
+   * when the `Policy` is created.
+   * 
+ * + * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. The kind of the `Policy`. Always contains the value
+   * `DenyPolicy`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kind. + */ + java.lang.String getKind(); + /** + * + * + *
+   * Output only. The kind of the `Policy`. Always contains the value
+   * `DenyPolicy`.
+   * 
+ * + * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * A user-specified description of the `Policy`. This value can be up to 63
+   * characters.
+   * 
+ * + * string display_name = 4; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * A user-specified description of the `Policy`. This value can be up to 63
+   * characters.
+   * 
+ * + * string display_name = 4; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * A key-value map to store arbitrary metadata for the `Policy`. Keys
+   * can be up to 63 characters. Values can be up to 255 characters.
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * An opaque tag that identifies the current version of the `Policy`. IAM uses
+   * this value to help manage concurrent updates, so they do not cause one
+   * update to be overwritten by another.
+   * If this field is present in a [CreatePolicy][] request, the value is
+   * ignored.
+   * 
+ * + * string etag = 6; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * An opaque tag that identifies the current version of the `Policy`. IAM uses
+   * this value to help manage concurrent updates, so they do not cause one
+   * update to be overwritten by another.
+   * If this field is present in a [CreatePolicy][] request, the value is
+   * ignored.
+   * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. The time when the `Policy` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time when the `Policy` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time when the `Policy` was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the `Policy` was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the `Policy` was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the `Policy` was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is
+   * not deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is
+   * not deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is
+   * not deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + java.util.List getRulesList(); + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + com.google.iam.v2.PolicyRule getRules(int index); + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + int getRulesCount(); + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + java.util.List getRulesOrBuilderList(); + /** + * + * + *
+   * A list of rules that specify the behavior of the `Policy`. All of the rules
+   * should be of the `kind` specified in the `Policy`.
+   * 
+ * + * repeated .google.iam.v2.PolicyRule rules = 10; + */ + com.google.iam.v2.PolicyRuleOrBuilder getRulesOrBuilder(int index); + + /** + * + * + *
+   * Immutable. Specifies that this policy is managed by an authority and can
+   * only be modified by that authority. Usage is restricted.
+   * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The managingAuthority. + */ + java.lang.String getManagingAuthority(); + /** + * + * + *
+   * Immutable. Specifies that this policy is managed by an authority and can
+   * only be modified by that authority. Usage is restricted.
+   * 
+ * + * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for managingAuthority. + */ + com.google.protobuf.ByteString getManagingAuthorityBytes(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java new file mode 100644 index 00000000..7b921a99 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java @@ -0,0 +1,290 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public final class PolicyProto { + private PolicyProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_Policy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_Policy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_Policy_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_PolicyRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_PolicyRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_ListPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_ListPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_GetPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_CreatePolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_DeletePolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\032google/iam/v2/policy.proto\022\rgoogle.iam" + + ".v2\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032\030google/iam/v2/deny.proto\032#g" + + "oogle/longrunning/operations.proto\032\037goog" + + "le/protobuf/timestamp.proto\"\302\003\n\006Policy\022\021" + + "\n\004name\030\001 \001(\tB\003\340A\005\022\020\n\003uid\030\002 \001(\tB\003\340A\005\022\021\n\004k" + + "ind\030\003 \001(\tB\003\340A\003\022\024\n\014display_name\030\004 \001(\t\022;\n\013" + + "annotations\030\005 \003(\0132&.google.iam.v2.Policy" + + ".AnnotationsEntry\022\014\n\004etag\030\006 \001(\t\0224\n\013creat" + + "e_time\030\007 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\0224\n\013update_time\030\010 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013delete_time\030\t \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022(\n\005rul" + + "es\030\n \003(\0132\031.google.iam.v2.PolicyRule\022\037\n\022m" + + "anaging_authority\030\013 \001(\tB\003\340A\005\0322\n\020Annotati" + + "onsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "\"W\n\nPolicyRule\022,\n\tdeny_rule\030\002 \001(\0132\027.goog" + + "le.iam.v2.DenyRuleH\000\022\023\n\013description\030\001 \001(" + + "\tB\006\n\004kind\"Q\n\023ListPoliciesRequest\022\023\n\006pare" + + "nt\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\"X\n\024ListPoliciesResponse\022\'\n\010" + + "policies\030\001 \003(\0132\025.google.iam.v2.Policy\022\027\n" + + "\017next_page_token\030\002 \001(\t\"%\n\020GetPolicyReque" + + "st\022\021\n\004name\030\001 \001(\tB\003\340A\002\"i\n\023CreatePolicyReq" + + "uest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022*\n\006policy\030\002 \001(" + + "\0132\025.google.iam.v2.PolicyB\003\340A\002\022\021\n\tpolicy_" + + "id\030\003 \001(\t\"A\n\023UpdatePolicyRequest\022*\n\006polic" + + "y\030\001 \001(\0132\025.google.iam.v2.PolicyB\003\340A\002\";\n\023D" + + "eletePolicyRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\"u\n\035ListApplicablePolici" + + "esRequest\022\035\n\020attachment_point\030\001 \001(\tB\003\340A\002" + + "\022\016\n\006filter\030\002 \001(\t\022\022\n\npage_token\030\003 \001(\t\022\021\n\t" + + "page_size\030\004 \001(\005\"x\n\036ListApplicablePolicie" + + "sResponse\022\'\n\010policies\030\001 \003(\0132\025.google.iam" + + ".v2.Policy\022\024\n\014inaccessible\030\002 \003(\t\022\027\n\017next" + + "_page_token\030\003 \001(\t\"J\n\027PolicyOperationMeta" + + "data\022/\n\013create_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp2\224\010\n\010Policies\022\203\001\n\014ListPolic" + + "ies\022\".google.iam.v2.ListPoliciesRequest\032" + + "#.google.iam.v2.ListPoliciesResponse\"*\202\323" + + "\344\223\002\033\022\031/v2/{parent=policies/*/*}\332A\006parent" + + "\022m\n\tGetPolicy\022\037.google.iam.v2.GetPolicyR" + + "equest\032\025.google.iam.v2.Policy\"(\202\323\344\223\002\033\022\031/" + + "v2/{name=policies/*/*/*}\332A\004name\022\272\001\n\014Crea" + + "tePolicy\022\".google.iam.v2.CreatePolicyReq" + + "uest\032\035.google.longrunning.Operation\"g\202\323\344" + + "\223\002#\"\031/v2/{parent=policies/*/*}:\006policy\332A" + + "\027parent,policy,policy_id\312A!\n\006Policy\022\027Pol" + + "icyOperationMetadata\022\247\001\n\014UpdatePolicy\022\"." + + "google.iam.v2.UpdatePolicyRequest\032\035.goog" + + "le.longrunning.Operation\"T\202\323\344\223\002*\032 /v2/{p" + + "olicy.name=policies/*/*/*}:\006policy\312A!\n\006P" + + "olicy\022\027PolicyOperationMetadata\022\237\001\n\014Delet" + + "ePolicy\022\".google.iam.v2.DeletePolicyRequ" + + "est\032\035.google.longrunning.Operation\"L\202\323\344\223" + + "\002\033*\031/v2/{name=policies/*/*/*}\332A\004name\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\022\301\001\n\026Lis" + + "tApplicablePolicies\022,.google.iam.v2.List" + + "ApplicablePoliciesRequest\032-.google.iam.v" + + "2.ListApplicablePoliciesResponse\"J\202\323\344\223\0021" + + "\022//v2/{attachment_point=*}:listApplicabl" + + "ePolicies\332A\020attachment_point\032F\312A\022iam.goo" + + "gleapis.com\322A.https://www.googleapis.com" + + "/auth/cloud-platformB\200\001\n\021com.google.iam." + + "v2B\013PolicyProtoP\001Z0google.golang.org/gen" + + "proto/googleapis/iam/v2;iam\252\002\023Google.Clo" + + "ud.Iam.V2\312\002\023Google\\Cloud\\Iam\\V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.iam.v2.DenyRuleProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_iam_v2_Policy_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v2_Policy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_Policy_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Kind", + "DisplayName", + "Annotations", + "Etag", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Rules", + "ManagingAuthority", + }); + internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor = + internal_static_google_iam_v2_Policy_descriptor.getNestedTypes().get(0); + internal_static_google_iam_v2_Policy_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_iam_v2_PolicyRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_iam_v2_PolicyRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_PolicyRule_descriptor, + new java.lang.String[] { + "DenyRule", "Description", "Kind", + }); + internal_static_google_iam_v2_ListPoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_ListPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_iam_v2_ListPoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_ListPoliciesResponse_descriptor, + new java.lang.String[] { + "Policies", "NextPageToken", + }); + internal_static_google_iam_v2_GetPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_GetPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_iam_v2_CreatePolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_CreatePolicyRequest_descriptor, + new java.lang.String[] { + "Parent", "Policy", "PolicyId", + }); + internal_static_google_iam_v2_UpdatePolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_UpdatePolicyRequest_descriptor, + new java.lang.String[] { + "Policy", + }); + internal_static_google_iam_v2_DeletePolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_DeletePolicyRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor, + new java.lang.String[] { + "AttachmentPoint", "Filter", "PageToken", "PageSize", + }); + internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor, + new java.lang.String[] { + "Policies", "Inaccessible", "NextPageToken", + }); + internal_static_google_iam_v2_PolicyOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_v2_PolicyOperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.iam.v2.DenyRuleProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java new file mode 100644 index 00000000..c1de50c9 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java @@ -0,0 +1,1007 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * A single rule in a `Policy`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.PolicyRule} + */ +public final class PolicyRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.PolicyRule) + PolicyRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRule.newBuilder() to construct. + private PolicyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PolicyRule() { + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PolicyRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PolicyRule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 18: + { + com.google.iam.v2.DenyRule.Builder subBuilder = null; + if (kindCase_ == 2) { + subBuilder = ((com.google.iam.v2.DenyRule) kind_).toBuilder(); + } + kind_ = input.readMessage(com.google.iam.v2.DenyRule.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.iam.v2.DenyRule) kind_); + kind_ = subBuilder.buildPartial(); + } + kindCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.PolicyRule.class, com.google.iam.v2.PolicyRule.Builder.class); + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public enum KindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DENY_RULE(2), + KIND_NOT_SET(0); + private final int value; + + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 2: + return DENY_RULE; + case 0: + return KIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public static final int DENY_RULE_FIELD_NUMBER = 2; + /** + * + * + *
+   * A rule for a deny policy.
+   * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + * + * @return Whether the denyRule field is set. + */ + @java.lang.Override + public boolean hasDenyRule() { + return kindCase_ == 2; + } + /** + * + * + *
+   * A rule for a deny policy.
+   * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + * + * @return The denyRule. + */ + @java.lang.Override + public com.google.iam.v2.DenyRule getDenyRule() { + if (kindCase_ == 2) { + return (com.google.iam.v2.DenyRule) kind_; + } + return com.google.iam.v2.DenyRule.getDefaultInstance(); + } + /** + * + * + *
+   * A rule for a deny policy.
+   * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + @java.lang.Override + public com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder() { + if (kindCase_ == 2) { + return (com.google.iam.v2.DenyRule) kind_; + } + return com.google.iam.v2.DenyRule.getDefaultInstance(); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object description_; + /** + * + * + *
+   * A user-specified description of the rule. This value can be up to 256
+   * characters.
+   * 
+ * + * string description = 1; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * A user-specified description of the rule. This value can be up to 256
+   * characters.
+   * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (kindCase_ == 2) { + output.writeMessage(2, (com.google.iam.v2.DenyRule) kind_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (kindCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.iam.v2.DenyRule) kind_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.PolicyRule)) { + return super.equals(obj); + } + com.google.iam.v2.PolicyRule other = (com.google.iam.v2.PolicyRule) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 2: + if (!getDenyRule().equals(other.getDenyRule())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + switch (kindCase_) { + case 2: + hash = (37 * hash) + DENY_RULE_FIELD_NUMBER; + hash = (53 * hash) + getDenyRule().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.PolicyRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.PolicyRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.PolicyRule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.PolicyRule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.PolicyRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.PolicyRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.PolicyRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.PolicyRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.PolicyRule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.PolicyRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.PolicyRule parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.PolicyRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.PolicyRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A single rule in a `Policy`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.PolicyRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.PolicyRule) + com.google.iam.v2.PolicyRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_PolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.PolicyRule.class, com.google.iam.v2.PolicyRule.Builder.class); + } + + // Construct using com.google.iam.v2.PolicyRule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + description_ = ""; + + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.PolicyRule getDefaultInstanceForType() { + return com.google.iam.v2.PolicyRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.PolicyRule build() { + com.google.iam.v2.PolicyRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.PolicyRule buildPartial() { + com.google.iam.v2.PolicyRule result = new com.google.iam.v2.PolicyRule(this); + if (kindCase_ == 2) { + if (denyRuleBuilder_ == null) { + result.kind_ = kind_; + } else { + result.kind_ = denyRuleBuilder_.build(); + } + } + result.description_ = description_; + result.kindCase_ = kindCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.PolicyRule) { + return mergeFrom((com.google.iam.v2.PolicyRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.PolicyRule other) { + if (other == com.google.iam.v2.PolicyRule.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + switch (other.getKindCase()) { + case DENY_RULE: + { + mergeDenyRule(other.getDenyRule()); + break; + } + case KIND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.PolicyRule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.PolicyRule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int kindCase_ = 0; + private java.lang.Object kind_; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.DenyRule, + com.google.iam.v2.DenyRule.Builder, + com.google.iam.v2.DenyRuleOrBuilder> + denyRuleBuilder_; + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + * + * @return Whether the denyRule field is set. + */ + @java.lang.Override + public boolean hasDenyRule() { + return kindCase_ == 2; + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + * + * @return The denyRule. + */ + @java.lang.Override + public com.google.iam.v2.DenyRule getDenyRule() { + if (denyRuleBuilder_ == null) { + if (kindCase_ == 2) { + return (com.google.iam.v2.DenyRule) kind_; + } + return com.google.iam.v2.DenyRule.getDefaultInstance(); + } else { + if (kindCase_ == 2) { + return denyRuleBuilder_.getMessage(); + } + return com.google.iam.v2.DenyRule.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + public Builder setDenyRule(com.google.iam.v2.DenyRule value) { + if (denyRuleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + denyRuleBuilder_.setMessage(value); + } + kindCase_ = 2; + return this; + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + public Builder setDenyRule(com.google.iam.v2.DenyRule.Builder builderForValue) { + if (denyRuleBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + denyRuleBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 2; + return this; + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + public Builder mergeDenyRule(com.google.iam.v2.DenyRule value) { + if (denyRuleBuilder_ == null) { + if (kindCase_ == 2 && kind_ != com.google.iam.v2.DenyRule.getDefaultInstance()) { + kind_ = + com.google.iam.v2.DenyRule.newBuilder((com.google.iam.v2.DenyRule) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 2) { + denyRuleBuilder_.mergeFrom(value); + } else { + denyRuleBuilder_.setMessage(value); + } + } + kindCase_ = 2; + return this; + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + public Builder clearDenyRule() { + if (denyRuleBuilder_ == null) { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + } + denyRuleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + public com.google.iam.v2.DenyRule.Builder getDenyRuleBuilder() { + return getDenyRuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + @java.lang.Override + public com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder() { + if ((kindCase_ == 2) && (denyRuleBuilder_ != null)) { + return denyRuleBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 2) { + return (com.google.iam.v2.DenyRule) kind_; + } + return com.google.iam.v2.DenyRule.getDefaultInstance(); + } + } + /** + * + * + *
+     * A rule for a deny policy.
+     * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.DenyRule, + com.google.iam.v2.DenyRule.Builder, + com.google.iam.v2.DenyRuleOrBuilder> + getDenyRuleFieldBuilder() { + if (denyRuleBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = com.google.iam.v2.DenyRule.getDefaultInstance(); + } + denyRuleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.DenyRule, + com.google.iam.v2.DenyRule.Builder, + com.google.iam.v2.DenyRuleOrBuilder>( + (com.google.iam.v2.DenyRule) kind_, getParentForChildren(), isClean()); + kind_ = null; + } + kindCase_ = 2; + onChanged(); + ; + return denyRuleBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * A user-specified description of the rule. This value can be up to 256
+     * characters.
+     * 
+ * + * string description = 1; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A user-specified description of the rule. This value can be up to 256
+     * characters.
+     * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A user-specified description of the rule. This value can be up to 256
+     * characters.
+     * 
+ * + * string description = 1; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A user-specified description of the rule. This value can be up to 256
+     * characters.
+     * 
+ * + * string description = 1; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * A user-specified description of the rule. This value can be up to 256
+     * characters.
+     * 
+ * + * string description = 1; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.PolicyRule) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.PolicyRule) + private static final com.google.iam.v2.PolicyRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.PolicyRule(); + } + + public static com.google.iam.v2.PolicyRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.PolicyRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java new file mode 100644 index 00000000..712ec072 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface PolicyRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.PolicyRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A rule for a deny policy.
+   * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + * + * @return Whether the denyRule field is set. + */ + boolean hasDenyRule(); + /** + * + * + *
+   * A rule for a deny policy.
+   * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + * + * @return The denyRule. + */ + com.google.iam.v2.DenyRule getDenyRule(); + /** + * + * + *
+   * A rule for a deny policy.
+   * 
+ * + * .google.iam.v2.DenyRule deny_rule = 2; + */ + com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder(); + + /** + * + * + *
+   * A user-specified description of the rule. This value can be up to 256
+   * characters.
+   * 
+ * + * string description = 1; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A user-specified description of the rule. This value can be up to 256
+   * characters.
+   * 
+ * + * string description = 1; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + public com.google.iam.v2.PolicyRule.KindCase getKindCase(); +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java new file mode 100644 index 00000000..d9f857e3 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java @@ -0,0 +1,755 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +/** + * + * + *
+ * Request message for `UpdatePolicy`.
+ * 
+ * + * Protobuf type {@code google.iam.v2.UpdatePolicyRequest} + */ +public final class UpdatePolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.v2.UpdatePolicyRequest) + UpdatePolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePolicyRequest.newBuilder() to construct. + private UpdatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePolicyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdatePolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.iam.v2.Policy.Builder subBuilder = null; + if (policy_ != null) { + subBuilder = policy_.toBuilder(); + } + policy_ = input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policy_); + policy_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.UpdatePolicyRequest.class, + com.google.iam.v2.UpdatePolicyRequest.Builder.class); + } + + public static final int POLICY_FIELD_NUMBER = 1; + private com.google.iam.v2.Policy policy_; + /** + * + * + *
+   * Required. The policy to update.
+   * To prevent conflicting updates, the `etag` value must match the value that
+   * is stored in IAM. If the `etag` values do not match, the request fails with
+   * a `409` error code and `ABORTED` status.
+   * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + @java.lang.Override + public boolean hasPolicy() { + return policy_ != null; + } + /** + * + * + *
+   * Required. The policy to update.
+   * To prevent conflicting updates, the `etag` value must match the value that
+   * is stored in IAM. If the `etag` values do not match, the request fails with
+   * a `409` error code and `ABORTED` status.
+   * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + @java.lang.Override + public com.google.iam.v2.Policy getPolicy() { + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; + } + /** + * + * + *
+   * Required. The policy to update.
+   * To prevent conflicting updates, the `etag` value must match the value that
+   * is stored in IAM. If the `etag` values do not match, the request fails with
+   * a `409` error code and `ABORTED` status.
+   * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { + return getPolicy(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (policy_ != null) { + output.writeMessage(1, getPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (policy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.v2.UpdatePolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v2.UpdatePolicyRequest other = (com.google.iam.v2.UpdatePolicyRequest) obj; + + if (hasPolicy() != other.hasPolicy()) return false; + if (hasPolicy()) { + if (!getPolicy().equals(other.getPolicy())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPolicy()) { + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v2.UpdatePolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.v2.UpdatePolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for `UpdatePolicy`.
+   * 
+ * + * Protobuf type {@code google.iam.v2.UpdatePolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v2.UpdatePolicyRequest) + com.google.iam.v2.UpdatePolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v2.UpdatePolicyRequest.class, + com.google.iam.v2.UpdatePolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v2.UpdatePolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyBuilder_ == null) { + policy_ = null; + } else { + policy_ = null; + policyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v2.PolicyProto + .internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v2.UpdatePolicyRequest getDefaultInstanceForType() { + return com.google.iam.v2.UpdatePolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v2.UpdatePolicyRequest build() { + com.google.iam.v2.UpdatePolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v2.UpdatePolicyRequest buildPartial() { + com.google.iam.v2.UpdatePolicyRequest result = + new com.google.iam.v2.UpdatePolicyRequest(this); + if (policyBuilder_ == null) { + result.policy_ = policy_; + } else { + result.policy_ = policyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v2.UpdatePolicyRequest) { + return mergeFrom((com.google.iam.v2.UpdatePolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v2.UpdatePolicyRequest other) { + if (other == com.google.iam.v2.UpdatePolicyRequest.getDefaultInstance()) return this; + if (other.hasPolicy()) { + mergePolicy(other.getPolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.v2.UpdatePolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.v2.UpdatePolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.iam.v2.Policy policy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + policyBuilder_; + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + public boolean hasPolicy() { + return policyBuilder_ != null || policy_ != null; + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + public com.google.iam.v2.Policy getPolicy() { + if (policyBuilder_ == null) { + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; + } else { + return policyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPolicy(com.google.iam.v2.Policy value) { + if (policyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + onChanged(); + } else { + policyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPolicy(com.google.iam.v2.Policy.Builder builderForValue) { + if (policyBuilder_ == null) { + policy_ = builderForValue.build(); + onChanged(); + } else { + policyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePolicy(com.google.iam.v2.Policy value) { + if (policyBuilder_ == null) { + if (policy_ != null) { + policy_ = com.google.iam.v2.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + } else { + policy_ = value; + } + onChanged(); + } else { + policyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPolicy() { + if (policyBuilder_ == null) { + policy_ = null; + onChanged(); + } else { + policy_ = null; + policyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.iam.v2.Policy.Builder getPolicyBuilder() { + + onChanged(); + return getPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { + if (policyBuilder_ != null) { + return policyBuilder_.getMessageOrBuilder(); + } else { + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; + } + } + /** + * + * + *
+     * Required. The policy to update.
+     * To prevent conflicting updates, the `etag` value must match the value that
+     * is stored in IAM. If the `etag` values do not match, the request fails with
+     * a `409` error code and `ABORTED` status.
+     * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder> + getPolicyFieldBuilder() { + if (policyBuilder_ == null) { + policyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v2.Policy, + com.google.iam.v2.Policy.Builder, + com.google.iam.v2.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); + policy_ = null; + } + return policyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.v2.UpdatePolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v2.UpdatePolicyRequest) + private static final com.google.iam.v2.UpdatePolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v2.UpdatePolicyRequest(); + } + + public static com.google.iam.v2.UpdatePolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.v2.UpdatePolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java b/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java new file mode 100644 index 00000000..fa20ec03 --- /dev/null +++ b/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/v2/policy.proto + +package com.google.iam.v2; + +public interface UpdatePolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v2.UpdatePolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The policy to update.
+   * To prevent conflicting updates, the `etag` value must match the value that
+   * is stored in IAM. If the `etag` values do not match, the request fails with
+   * a `409` error code and `ABORTED` status.
+   * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the policy field is set. + */ + boolean hasPolicy(); + /** + * + * + *
+   * Required. The policy to update.
+   * To prevent conflicting updates, the `etag` value must match the value that
+   * is stored in IAM. If the `etag` values do not match, the request fails with
+   * a `409` error code and `ABORTED` status.
+   * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policy. + */ + com.google.iam.v2.Policy getPolicy(); + /** + * + * + *
+   * Required. The policy to update.
+   * To prevent conflicting updates, the `etag` value must match the value that
+   * is stored in IAM. If the `etag` values do not match, the request fails with
+   * a `409` error code and `ABORTED` status.
+   * 
+ * + * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder(); +} diff --git a/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto b/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto new file mode 100644 index 00000000..db9f15f8 --- /dev/null +++ b/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto @@ -0,0 +1,109 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://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, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.iam.v2; + +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V2"; +option go_package = "google.golang.org/genproto/googleapis/iam/v2;iam"; +option java_multiple_files = true; +option java_outer_classname = "DenyRuleProto"; +option java_package = "com.google.iam.v2"; +option php_namespace = "Google\\Cloud\\Iam\\V2"; + +// A deny rule in an IAM deny policy. +message DenyRule { + // The identities that are prevented from using one or more permissions on + // Google Cloud resources. This field can contain the following values: + // + // * `principalSet://goog/public:all`: A special identifier that represents + // any principal that is on the internet, even if they do not have a Google + // Account or are not logged in. + // + // * `principal://goog/subject/{email_id}`: A specific Google Account. + // Includes Gmail, Cloud Identity, and Google Workspace user accounts. For + // example, `principal://goog/subject/alice@example.com`. + // + // * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific + // Google Account that was deleted recently. For example, + // `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If + // the Google Account is recovered, this identifier reverts to the standard + // identifier for a Google Account. + // + // * `principalSet://goog/group/{group_id}`: A Google group. For example, + // `principalSet://goog/group/admins@example.com`. + // + // * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group + // that was deleted recently. For example, + // `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If + // the Google group is restored, this identifier reverts to the standard + // identifier for a Google group. + // + // * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`: + // A Google Cloud service account. For example, + // `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`. + // + // * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`: + // A Google Cloud service account that was deleted recently. For example, + // `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`. + // If the service account is undeleted, this identifier reverts to the + // standard identifier for a service account. + // + // * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the + // principals associated with the specified Google Workspace or Cloud + // Identity customer ID. For example, + // `principalSet://goog/cloudIdentityCustomerId/C01Abc35`. + repeated string denied_principals = 1; + + // The identities that are excluded from the deny rule, even if they are + // listed in the `denied_principals`. For example, you could add a Google + // group to the `denied_principals`, then exclude specific users who belong to + // that group. + // + // This field can contain the same values as the `denied_principals` field, + // excluding `principalSet://goog/public:all`, which represents all users on + // the internet. + repeated string exception_principals = 2; + + // The permissions that are explicitly denied by this rule. Each permission + // uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}` + // is the fully qualified domain name for the service. For example, + // `iam.googleapis.com/roles.list`. + repeated string denied_permissions = 3; + + // Specifies the permissions that this rule excludes from the set of denied + // permissions given by `denied_permissions`. If a permission appears in + // `denied_permissions` _and_ in `exception_permissions` then it will _not_ be + // denied. + // + // The excluded permissions can be specified using the same syntax as + // `denied_permissions`. + repeated string exception_permissions = 4; + + // The condition that determines whether this deny rule applies to a request. + // If the condition expression evaluates to `true`, then the deny rule is + // applied; otherwise, the deny rule is not applied. + // + // Each deny rule is evaluated independently. If this deny rule does not apply + // to a request, other deny rules might still apply. + // + // The condition can use CEL functions that evaluate + // [resource + // tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other + // functions and operators are not supported. + google.type.Expr denial_condition = 5; +} diff --git a/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto b/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto new file mode 100644 index 00000000..b21d44fa --- /dev/null +++ b/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto @@ -0,0 +1,376 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://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, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.iam.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/iam/v2/deny.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V2"; +option go_package = "google.golang.org/genproto/googleapis/iam/v2;iam"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.iam.v2"; +option php_namespace = "Google\\Cloud\\Iam\\V2"; + +// An interface for managing Identity and Access Management (IAM) policies. +service Policies { + option (google.api.default_host) = "iam.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the policies of the specified kind that are attached to a + // resource. + // + // The response lists only policy metadata. In particular, policy rules are + // omitted. + rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse) { + option (google.api.http) = { + get: "/v2/{parent=policies/*/*}" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a policy. + rpc GetPolicy(GetPolicyRequest) returns (Policy) { + option (google.api.http) = { + get: "/v2/{name=policies/*/*/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a policy. + rpc CreatePolicy(CreatePolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=policies/*/*}" + body: "policy" + }; + option (google.api.method_signature) = "parent,policy,policy_id"; + option (google.longrunning.operation_info) = { + response_type: "Policy" + metadata_type: "PolicyOperationMetadata" + }; + } + + // Updates the specified policy. + // + // You can update only the rules and the display name for the policy. + // + // To update a policy, you should use a read-modify-write loop: + // + // 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current + // version of the policy. + // 2. Modify the policy as needed. + // 3. Use `UpdatePolicy` to write the updated policy. + // + // This pattern helps prevent conflicts between concurrent updates. + rpc UpdatePolicy(UpdatePolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + put: "/v2/{policy.name=policies/*/*/*}" + body: "policy" + }; + option (google.longrunning.operation_info) = { + response_type: "Policy" + metadata_type: "PolicyOperationMetadata" + }; + } + + // Deletes a policy. This action is permanent. + rpc DeletePolicy(DeletePolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=policies/*/*/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Policy" + metadata_type: "PolicyOperationMetadata" + }; + } + + // Retrieves all the policies that are attached to the specified resource, + // or anywhere in the ancestry of the resource. For example, for a project + // this endpoint would return all the `denyPolicy` kind policies attached to + // the project, its parent folder (if any), and its parent organization (if + // any). + // The endpoint requires the same permissions that it would take to call + // `ListPolicies` or `GetPolicy`. + // + // The main reason to use this endpoint is as a policy admin to debug access + // issues for a resource. + rpc ListApplicablePolicies(ListApplicablePoliciesRequest) + returns (ListApplicablePoliciesResponse) { + option (google.api.http) = { + get: "/v2/{attachment_point=*}:listApplicablePolicies" + }; + option (google.api.method_signature) = "attachment_point"; + } +} + +// Data for an IAM policy. +message Policy { + // Immutable. The resource name of the `Policy`, which must be unique. Format: + // `policies/{attachment_point}/denypolicies/{policy_id}` + // + // + // The attachment point is identified by its URL-encoded full resource name, + // which means that the forward-slash character, `/`, must be written as + // `%2F`. For example, + // `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`. + // + // For organizations and folders, use the numeric ID in the full resource + // name. For projects, requests can use the alphanumeric or the numeric ID. + // Responses always contain the numeric ID. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The globally unique ID of the `Policy`. Assigned automatically + // when the `Policy` is created. + string uid = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The kind of the `Policy`. Always contains the value + // `DenyPolicy`. + string kind = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A user-specified description of the `Policy`. This value can be up to 63 + // characters. + string display_name = 4; + + // A key-value map to store arbitrary metadata for the `Policy`. Keys + // can be up to 63 characters. Values can be up to 255 characters. + map annotations = 5; + + // An opaque tag that identifies the current version of the `Policy`. IAM uses + // this value to help manage concurrent updates, so they do not cause one + // update to be overwritten by another. + // + // If this field is present in a [CreatePolicy][] request, the value is + // ignored. + string etag = 6; + + // Output only. The time when the `Policy` was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the `Policy` was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the `Policy` was deleted. Empty if the policy is + // not deleted. + google.protobuf.Timestamp delete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A list of rules that specify the behavior of the `Policy`. All of the rules + // should be of the `kind` specified in the `Policy`. + repeated PolicyRule rules = 10; + + // Immutable. Specifies that this policy is managed by an authority and can + // only be modified by that authority. Usage is restricted. + string managing_authority = 11 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A single rule in a `Policy`. +message PolicyRule { + oneof kind { + // A rule for a deny policy. + DenyRule deny_rule = 2; + } + + // A user-specified description of the rule. This value can be up to 256 + // characters. + string description = 1; +} + +// Request message for `ListPolicies`. +message ListPoliciesRequest { + // Required. The resource that the policy is attached to, along with the kind + // of policy to list. Format: `policies/{attachment_point}/denypolicies` + // + // + // The attachment point is identified by its URL-encoded full resource name, + // which means that the forward-slash character, `/`, must be written as + // `%2F`. For example, + // `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + // + // For organizations and folders, use the numeric ID in the full resource + // name. For projects, you can use the alphanumeric or the numeric ID. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of policies to return. IAM ignores this value and uses + // the value 1000. + int32 page_size = 2; + + // A page token received in a + // [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this + // token to retrieve the next page. + string page_token = 3; +} + +// Response message for `ListPolicies`. +message ListPoliciesResponse { + // Metadata for the policies that are attached to the resource. + repeated Policy policies = 1; + + // A page token that you can use in a + // [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the + // next page. If this field is omitted, there are no additional pages. + string next_page_token = 2; +} + +// Request message for `GetPolicy`. +message GetPolicyRequest { + // Required. The resource name of the policy to retrieve. Format: + // `policies/{attachment_point}/denypolicies/{policy_id}` + // + // + // Use the URL-encoded full resource name, which means that the forward-slash + // character, `/`, must be written as `%2F`. For example, + // `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + // + // For organizations and folders, use the numeric ID in the full resource + // name. For projects, you can use the alphanumeric or the numeric ID. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for `CreatePolicy`. +message CreatePolicyRequest { + // Required. The resource that the policy is attached to, along with the kind + // of policy to create. Format: `policies/{attachment_point}/denypolicies` + // + // + // The attachment point is identified by its URL-encoded full resource name, + // which means that the forward-slash character, `/`, must be written as + // `%2F`. For example, + // `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + // + // For organizations and folders, use the numeric ID in the full resource + // name. For projects, you can use the alphanumeric or the numeric ID. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The policy to create. + Policy policy = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for this policy, which will become the final component of + // the policy's resource name. The ID must contain 3 to 63 characters. It can + // contain lowercase letters and numbers, as well as dashes (`-`) and periods + // (`.`). The first character must be a lowercase letter. + string policy_id = 3; +} + +// Request message for `UpdatePolicy`. +message UpdatePolicyRequest { + // Required. The policy to update. + // + // To prevent conflicting updates, the `etag` value must match the value that + // is stored in IAM. If the `etag` values do not match, the request fails with + // a `409` error code and `ABORTED` status. + Policy policy = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for `DeletePolicy`. +message DeletePolicyRequest { + // Required. The resource name of the policy to delete. Format: + // `policies/{attachment_point}/denypolicies/{policy_id}` + // + // + // Use the URL-encoded full resource name, which means that the forward-slash + // character, `/`, must be written as `%2F`. For example, + // `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + // + // For organizations and folders, use the numeric ID in the full resource + // name. For projects, you can use the alphanumeric or the numeric ID. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The expected `etag` of the policy to delete. If the value does + // not match the value that is stored in IAM, the request fails with a `409` + // error code and `ABORTED` status. + // + // If you omit this field, the policy is deleted regardless of its current + // `etag`. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListApplicablePoliciesRequest` represents the Request message for the +// `ListApplicablePolicies` method. It provides the input for a filterable query +// of Policies that apply to a certain GCP Resource, specified by the field +// `attachment_point`, found on this message. +// Example: +// ``` +// { +// attachment_point: +// 'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901' +// filter: 'kind:denyPolicies' +// } +// ``` +message ListApplicablePoliciesRequest { + // Required. The Cloud resource at which the applicable policies are to be + // retrieved. Format: `{attachment-point}` Use the URL-encoded full resource + // name, which means that the forward-slash character, `/`, must be written as + // `%2F`. For example, + // `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. + string attachment_point = 1 [(google.api.field_behavior) = REQUIRED]; + + // Filtering currently only supports the kind of policies to return, and + // must be in the format β€œkind:[policyKind1] OR kind:[policyKind2]”. New + // policy kinds may be added in the future without notice. + // + // Example value: β€œkind:denyPolicies” + string filter = 2; + + // If present, then retrieve the batch of results following the results from + // the preceding call to this method. `page_token` must be the value of + // `next_page_token` + // [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token] + // from the previous response. The values of other method parameters should + // be identical to those in the previous call. + string page_token = 3; + + // Limit on the number of policies to include in the response. + // Further policies can subsequently be obtained by including the + // [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token] + // in a subsequent request. + // The minimum is 25, and the maximum is 100. + int32 page_size = 4; +} + +// Response message for [ListApplicablePolicies][] method. +message ListApplicablePoliciesResponse { + // Ordered list starting from the resource on which this API was called + // then proceeding up the hierarchy. Policies for the same attachment point + // will be grouped, but no further ordering is guaranteed. + repeated Policy policies = 1; + + // A list of resources that the caller does not have permission to retrieve. + // List or Get can be used to get detailed error messages. + // Get: `policies/{attachment-point}/denypolicies/{policy-id}` + // List: `policies/{attachment-point}/denypolicies` + repeated string inaccessible = 2; + + // A page token that can be used in a + // [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest] + // to retrieve the next page. If this field is blank, there are no additional + // pages. + string next_page_token = 3; +} + +// Metadata for long-running `Policy` operations. +message PolicyOperationMetadata { + // Timestamp when the `google.longrunning.Operation` was created. + google.protobuf.Timestamp create_time = 1; +} diff --git a/versions.txt b/versions.txt index 8f0502c0..e7048b1c 100644 --- a/versions.txt +++ b/versions.txt @@ -6,3 +6,5 @@ grpc-google-iam-v1:1.5.2:1.5.3-SNAPSHOT proto-google-iam-v2beta:1.5.2:1.5.3-SNAPSHOT grpc-google-iam-v2beta:1.5.2:1.5.3-SNAPSHOT google-iam-policy:1.5.2:1.5.3-SNAPSHOT +proto-google-iam-v2:1.5.2:1.5.3-SNAPSHOT +grpc-google-iam-v2:1.5.2:1.5.3-SNAPSHOT From 6da2bd228c5e3b9f6d9d35e95b955c7fbd65807d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Sep 2022 15:38:25 +0200 Subject: [PATCH 40/44] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 (#426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.2` -> `3.0.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/compatibility-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/confidence-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.3`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​303-httpsgithubcomgoogleapisjava-shared-dependenciescomparev302v303-2022-09-14) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.2...v3.0.3) ##### Dependencies - Google-cloud-core 2.8.12 ([#​799](https://togithub.com/googleapis/java-shared-dependencies/issues/799)) ([1b3db8d](https://togithub.com/googleapis/java-shared-dependencies/commit/1b3db8d1e17c49ebae79fc96164fa9058e1df6e3)) - Moving gson to first-party-dependencies ([#​800](https://togithub.com/googleapis/java-shared-dependencies/issues/800)) ([a41fcc1](https://togithub.com/googleapis/java-shared-dependencies/commit/a41fcc11d32e02e5af2837561792e3919f6d4b3f)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.6 ([#​797](https://togithub.com/googleapis/java-shared-dependencies/issues/797)) ([bc5fdc9](https://togithub.com/googleapis/java-shared-dependencies/commit/bc5fdc9b3af7973c28f063a9ac156fe2af562814)) - Update gax.version to v2.19.1 ([#​798](https://togithub.com/googleapis/java-shared-dependencies/issues/798)) ([84e5487](https://togithub.com/googleapis/java-shared-dependencies/commit/84e5487b2e3dce4bb60badecebde788c3cb702b8)) - Update google.core.version to v2.8.11 ([#​793](https://togithub.com/googleapis/java-shared-dependencies/issues/793)) ([63c1297](https://togithub.com/googleapis/java-shared-dependencies/commit/63c129722aa0b821031ff5b4c11004adf7b12044))
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 21d1d301..e844209d 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.2 + 3.0.3 pom import From c7b26dd62e4b22634f15e4eb19d96c3dfc919d11 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 17:30:42 +0200 Subject: [PATCH 41/44] deps: update dependency io.grpc:grpc-protobuf to v1.49.1 (#427) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-protobuf](https://togithub.com/grpc/grpc-java) | `1.49.0` -> `1.49.1` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.1/compatibility-slim/1.49.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-protobuf/1.49.1/confidence-slim/1.49.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes
grpc/grpc-java ### [`v1.49.1`](https://togithub.com/grpc/grpc-java/compare/v1.49.0...v1.49.1)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index ef0395bd..3130f0aa 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -19,7 +19,7 @@ repositories { dependencies { compile 'io.grpc:grpc-stub:1.49.0' - compile 'io.grpc:grpc-protobuf:1.49.0' + compile 'io.grpc:grpc-protobuf:1.49.1' compile project(':proto-google-iam-v1') } From d10250215733d144af9611bf649eea3320a06f18 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 17:32:40 +0200 Subject: [PATCH 42/44] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.2 (#429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.1` -> `26.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/compatibility-slim/26.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/confidence-slim/26.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- samples/cloud-client/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cloud-client/snippets/pom.xml b/samples/cloud-client/snippets/pom.xml index e2bab760..b1fb9963 100644 --- a/samples/cloud-client/snippets/pom.xml +++ b/samples/cloud-client/snippets/pom.xml @@ -72,7 +72,7 @@ com.google.cloud import pom - 26.1.1 + 26.1.2
From ad6f449c6fdfbf91a89561359ef2f124e9d8dfa2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 17:44:17 +0200 Subject: [PATCH 43/44] deps: update dependency io.grpc:grpc-stub to v1.49.1 (#428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.grpc:grpc-stub](https://togithub.com/grpc/grpc-java) | `1.49.0` -> `1.49.1` | [![age](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.1/compatibility-slim/1.49.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.grpc:grpc-stub/1.49.1/confidence-slim/1.49.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes
grpc/grpc-java ### [`v1.49.1`](https://togithub.com/grpc/grpc-java/compare/v1.49.0...v1.49.1)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam). --- grpc-google-iam-v1/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc-google-iam-v1/build.gradle b/grpc-google-iam-v1/build.gradle index 3130f0aa..18d0ad19 100644 --- a/grpc-google-iam-v1/build.gradle +++ b/grpc-google-iam-v1/build.gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - compile 'io.grpc:grpc-stub:1.49.0' + compile 'io.grpc:grpc-stub:1.49.1' compile 'io.grpc:grpc-protobuf:1.49.1' compile project(':proto-google-iam-v1') } From 5976d802c205ce9232e727f642bbf6f324ca3495 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 10:00:05 -0400 Subject: [PATCH 44/44] chore(main): release 1.6.0 (#408) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++ google-iam-policy/pom.xml | 4 +-- grpc-google-iam-v1/pom.xml | 4 +-- grpc-google-iam-v2/pom.xml | 4 +-- grpc-google-iam-v2beta/pom.xml | 4 +-- pom.xml | 16 ++++++------ proto-google-iam-v1/pom.xml | 4 +-- proto-google-iam-v2/pom.xml | 4 +-- proto-google-iam-v2beta/pom.xml | 4 +-- versions.txt | 14 +++++----- 10 files changed, 74 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0746810d..ec1bf1e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,50 @@ # Changelog +## [1.6.0](https://github.com/googleapis/java-iam/compare/v1.5.2...v1.6.0) (2022-09-20) + + +### Features + +* Add v2 client ([#423](https://github.com/googleapis/java-iam/issues/423)) ([6b6c24f](https://github.com/googleapis/java-iam/commit/6b6c24f11093d2ccc5e5005337576db7c9626ec0)) +* Update the public IAM Deny v2beta API ([5894873](https://github.com/googleapis/java-iam/commit/58948731feee6462ae75f6fe11c31e36e9ec6fce)) + + +### Documentation + +* **samples:** Update param values ([#401](https://github.com/googleapis/java-iam/issues/401)) ([8879c28](https://github.com/googleapis/java-iam/commit/8879c28cac3543c441be636da626bcc3c10509da)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220710-1.32.1 ([#383](https://github.com/googleapis/java-iam/issues/383)) ([0670b46](https://github.com/googleapis/java-iam/commit/0670b461db649b2be307735aa128e8273d42d38f)) +* Update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220710-2.0.0 ([#396](https://github.com/googleapis/java-iam/issues/396)) ([ec96383](https://github.com/googleapis/java-iam/commit/ec96383900c271ddf96a58772ff459c6879c106f)) +* Update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220731-2.0.0 ([#402](https://github.com/googleapis/java-iam/issues/402)) ([39605e5](https://github.com/googleapis/java-iam/commit/39605e5b1cb4ee9fea068e36a6452e02710ae03d)) +* Update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220807-2.0.0 ([#407](https://github.com/googleapis/java-iam/issues/407)) ([475fa93](https://github.com/googleapis/java-iam/commit/475fa93c1b5affb19eec36856e719041d5bf56af)) +* Update dependency com.google.apis:google-api-services-cloudresourcemanager to v3-rev20220828-2.0.0 ([#417](https://github.com/googleapis/java-iam/issues/417)) ([f3b365d](https://github.com/googleapis/java-iam/commit/f3b365df695b61515871c24dd2d14cde015ad599)) +* Update dependency com.google.apis:google-api-services-iam to v2beta-rev20220713-1.32.1 ([#390](https://github.com/googleapis/java-iam/issues/390)) ([9bef280](https://github.com/googleapis/java-iam/commit/9bef280b9c871ad9333daa8f027b8679f91ccbb1)) +* Update dependency com.google.apis:google-api-services-iam to v2beta-rev20220713-2.0.0 ([#403](https://github.com/googleapis/java-iam/issues/403)) ([7a8270b](https://github.com/googleapis/java-iam/commit/7a8270b691b5c749c90185659bd3a51480c3e1c4)) +* Update dependency com.google.apis:google-api-services-iamcredentials to v1-rev20211203-2.0.0 ([#404](https://github.com/googleapis/java-iam/issues/404)) ([ee3537d](https://github.com/googleapis/java-iam/commit/ee3537d763c389d25d887fb1b2cfc61ff4101d65)) +* Update dependency com.google.auth:google-auth-library-oauth2-http to v1.10.0 ([#406](https://github.com/googleapis/java-iam/issues/406)) ([56284df](https://github.com/googleapis/java-iam/commit/56284df32ee657a5055e6dea3bd7b25772c218ea)) +* Update dependency com.google.auth:google-auth-library-oauth2-http to v1.11.0 ([#419](https://github.com/googleapis/java-iam/issues/419)) ([3375ba3](https://github.com/googleapis/java-iam/commit/3375ba3a5b44d97370233238a63e1a310b5b605a)) +* Update dependency com.google.auth:google-auth-library-oauth2-http to v1.8.1 ([#385](https://github.com/googleapis/java-iam/issues/385)) ([e6199b3](https://github.com/googleapis/java-iam/commit/e6199b3c094f606359c8e469a853a283cd82c836)) +* Update dependency com.google.auth:google-auth-library-oauth2-http to v1.9.0 ([#400](https://github.com/googleapis/java-iam/issues/400)) ([aa4e5b6](https://github.com/googleapis/java-iam/commit/aa4e5b6ec5af98925c4353c9393e33c423c67a60)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#395](https://github.com/googleapis/java-iam/issues/395)) ([a88edd6](https://github.com/googleapis/java-iam/commit/a88edd61e1a66c5f48185dd5e8a2a61e5e9a002e)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.1 ([#399](https://github.com/googleapis/java-iam/issues/399)) ([bf814a9](https://github.com/googleapis/java-iam/commit/bf814a9faf878195676937cfe793b4a20fff6f06)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#420](https://github.com/googleapis/java-iam/issues/420)) ([e358921](https://github.com/googleapis/java-iam/commit/e358921e5ade85359a97b6a19af7a8397227c428)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#426](https://github.com/googleapis/java-iam/issues/426)) ([6da2bd2](https://github.com/googleapis/java-iam/commit/6da2bd228c5e3b9f6d9d35e95b955c7fbd65807d)) +* Update dependency com.google.http-client:google-http-client-jackson2 to v1.42.2 ([#386](https://github.com/googleapis/java-iam/issues/386)) ([de1b271](https://github.com/googleapis/java-iam/commit/de1b27180bf93a5c9b5a9a274f9d5a2c2ff5afc1)) +* Update dependency com.google.protobuf:protobuf-java to v3.21.3 ([#391](https://github.com/googleapis/java-iam/issues/391)) ([02a3c56](https://github.com/googleapis/java-iam/commit/02a3c56b1143d497b98e2f437d9b36ea468e36ea)) +* Update dependency com.google.protobuf:protobuf-java to v3.21.4 ([#393](https://github.com/googleapis/java-iam/issues/393)) ([f4c649b](https://github.com/googleapis/java-iam/commit/f4c649b67c0a8fa950487b3e3b2f10ab85136165)) +* Update dependency com.google.protobuf:protobuf-java to v3.21.5 ([#405](https://github.com/googleapis/java-iam/issues/405)) ([66b27cb](https://github.com/googleapis/java-iam/commit/66b27cb9722cac68af7844447524f149fb08b3b0)) +* Update dependency io.grpc:grpc-protobuf to v1.48.0 ([#388](https://github.com/googleapis/java-iam/issues/388)) ([d7beea4](https://github.com/googleapis/java-iam/commit/d7beea4de4aff35f998b017c6d6136c76ec1e36b)) +* Update dependency io.grpc:grpc-protobuf to v1.48.1 ([#397](https://github.com/googleapis/java-iam/issues/397)) ([512a655](https://github.com/googleapis/java-iam/commit/512a6554067bbbe9ac400f833a0a8cd4bfaef785)) +* Update dependency io.grpc:grpc-protobuf to v1.49.0 ([#413](https://github.com/googleapis/java-iam/issues/413)) ([93ac43d](https://github.com/googleapis/java-iam/commit/93ac43deb5a663bd22b5d14f8ba7a4bdff6928cd)) +* Update dependency io.grpc:grpc-protobuf to v1.49.1 ([#427](https://github.com/googleapis/java-iam/issues/427)) ([c7b26dd](https://github.com/googleapis/java-iam/commit/c7b26dd62e4b22634f15e4eb19d96c3dfc919d11)) +* Update dependency io.grpc:grpc-stub to v1.48.0 ([#389](https://github.com/googleapis/java-iam/issues/389)) ([c76beb0](https://github.com/googleapis/java-iam/commit/c76beb01ba7a59cdfe60fc498f33881faadafe89)) +* Update dependency io.grpc:grpc-stub to v1.48.1 ([#398](https://github.com/googleapis/java-iam/issues/398)) ([4917a59](https://github.com/googleapis/java-iam/commit/4917a59ae856825e6e96a5b3ca0d766b8a931de6)) +* Update dependency io.grpc:grpc-stub to v1.49.0 ([#414](https://github.com/googleapis/java-iam/issues/414)) ([1d98460](https://github.com/googleapis/java-iam/commit/1d9846000bf41f20907dfcbc11574e88f91cc8f8)) +* Update dependency io.grpc:grpc-stub to v1.49.1 ([#428](https://github.com/googleapis/java-iam/issues/428)) ([ad6f449](https://github.com/googleapis/java-iam/commit/ad6f449c6fdfbf91a89561359ef2f124e9d8dfa2)) + ## [1.5.2](https://github.com/googleapis/java-iam/compare/v1.5.1...v1.5.2) (2022-07-13) diff --git a/google-iam-policy/pom.xml b/google-iam-policy/pom.xml index 7b320083..e7bb9c3e 100644 --- a/google-iam-policy/pom.xml +++ b/google-iam-policy/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-iam-policy - 1.5.3-SNAPSHOT + 1.6.0 jar Google IAM Policy https://github.com/googleapis/java-eventarc @@ -11,7 +11,7 @@ com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 google-iam-policy diff --git a/grpc-google-iam-v1/pom.xml b/grpc-google-iam-v1/pom.xml index 825a4ca0..6e2d58a9 100644 --- a/grpc-google-iam-v1/pom.xml +++ b/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.5.3-SNAPSHOT + 1.6.0 grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/grpc-google-iam-v2/pom.xml b/grpc-google-iam-v2/pom.xml index 25ca35fc..77dbe5bb 100644 --- a/grpc-google-iam-v2/pom.xml +++ b/grpc-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2 - 1.5.3-SNAPSHOT + 1.6.0 grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/grpc-google-iam-v2beta/pom.xml b/grpc-google-iam-v2beta/pom.xml index 909fe96e..2f0729e7 100644 --- a/grpc-google-iam-v2beta/pom.xml +++ b/grpc-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2beta - 1.5.3-SNAPSHOT + 1.6.0 grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/pom.xml b/pom.xml index e844209d..0ce6d7c9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.5.3-SNAPSHOT + 1.6.0 Google IAM Parent https://github.com/googleapis/java-iam @@ -77,37 +77,37 @@ com.google.api.grpc proto-google-iam-v2 - 1.5.3-SNAPSHOT + 1.6.0 com.google.api.grpc grpc-google-iam-v2 - 1.5.3-SNAPSHOT + 1.6.0 com.google.cloud google-iam-policy - 1.5.3-SNAPSHOT + 1.6.0 com.google.api.grpc proto-google-iam-v2beta - 1.5.3-SNAPSHOT + 1.6.0 com.google.api.grpc grpc-google-iam-v1 - 1.5.3-SNAPSHOT + 1.6.0 com.google.api.grpc grpc-google-iam-v2beta - 1.5.3-SNAPSHOT + 1.6.0 com.google.api.grpc proto-google-iam-v1 - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/proto-google-iam-v1/pom.xml b/proto-google-iam-v1/pom.xml index c1e7b535..001d49a3 100644 --- a/proto-google-iam-v1/pom.xml +++ b/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.5.3-SNAPSHOT + 1.6.0 proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/proto-google-iam-v2/pom.xml b/proto-google-iam-v2/pom.xml index 55b0666e..fe8d2030 100644 --- a/proto-google-iam-v2/pom.xml +++ b/proto-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2 - 1.5.3-SNAPSHOT + 1.6.0 proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/proto-google-iam-v2beta/pom.xml b/proto-google-iam-v2beta/pom.xml index d2d43f45..c6d63a0a 100644 --- a/proto-google-iam-v2beta/pom.xml +++ b/proto-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2beta - 1.5.3-SNAPSHOT + 1.6.0 proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.5.3-SNAPSHOT + 1.6.0 diff --git a/versions.txt b/versions.txt index e7048b1c..5d8698a5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -proto-google-iam-v1:1.5.2:1.5.3-SNAPSHOT -grpc-google-iam-v1:1.5.2:1.5.3-SNAPSHOT -proto-google-iam-v2beta:1.5.2:1.5.3-SNAPSHOT -grpc-google-iam-v2beta:1.5.2:1.5.3-SNAPSHOT -google-iam-policy:1.5.2:1.5.3-SNAPSHOT -proto-google-iam-v2:1.5.2:1.5.3-SNAPSHOT -grpc-google-iam-v2:1.5.2:1.5.3-SNAPSHOT +proto-google-iam-v1:1.6.0:1.6.0 +grpc-google-iam-v1:1.6.0:1.6.0 +proto-google-iam-v2beta:1.6.0:1.6.0 +grpc-google-iam-v2beta:1.6.0:1.6.0 +google-iam-policy:1.6.0:1.6.0 +proto-google-iam-v2:1.6.0:1.6.0 +grpc-google-iam-v2:1.6.0:1.6.0