From b045913c75bc3733f68bd0203ebcd08f34a15d6c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 1 Jul 2022 04:04:13 +0000 Subject: [PATCH 01/14] chore(main): release 0.5.2-SNAPSHOT (#177) :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-cloud-network-security-bom/pom.xml | 8 ++++---- google-cloud-network-security/pom.xml | 4 ++-- grpc-google-cloud-network-security-v1beta1/pom.xml | 4 ++-- pom.xml | 8 ++++---- proto-google-cloud-network-security-v1beta1/pom.xml | 4 ++-- versions.txt | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/google-cloud-network-security-bom/pom.xml b/google-cloud-network-security-bom/pom.xml index f60ca1da..d2778f31 100644 --- a/google-cloud-network-security-bom/pom.xml +++ b/google-cloud-network-security-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-network-security-bom - 0.5.1 + 0.5.2-SNAPSHOT pom com.google.cloud @@ -56,17 +56,17 @@ com.google.cloud google-cloud-network-security - 0.5.1 + 0.5.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-network-security-v1beta1 - 0.5.1 + 0.5.2-SNAPSHOT com.google.api.grpc proto-google-cloud-network-security-v1beta1 - 0.5.1 + 0.5.2-SNAPSHOT diff --git a/google-cloud-network-security/pom.xml b/google-cloud-network-security/pom.xml index a1be755b..dc28a3ec 100644 --- a/google-cloud-network-security/pom.xml +++ b/google-cloud-network-security/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-network-security - 0.5.1 + 0.5.2-SNAPSHOT jar Google Network Security API https://github.com/googleapis/java-network-security @@ -11,7 +11,7 @@ com.google.cloud google-cloud-network-security-parent - 0.5.1 + 0.5.2-SNAPSHOT google-cloud-network-security diff --git a/grpc-google-cloud-network-security-v1beta1/pom.xml b/grpc-google-cloud-network-security-v1beta1/pom.xml index 827ab59d..9076f395 100644 --- a/grpc-google-cloud-network-security-v1beta1/pom.xml +++ b/grpc-google-cloud-network-security-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-network-security-v1beta1 - 0.5.1 + 0.5.2-SNAPSHOT grpc-google-cloud-network-security-v1beta1 GRPC library for google-cloud-network-security com.google.cloud google-cloud-network-security-parent - 0.5.1 + 0.5.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index ee99fa6d..f466cc0f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-network-security-parent pom - 0.5.1 + 0.5.2-SNAPSHOT Google Network Security API Parent https://github.com/googleapis/java-network-security @@ -69,17 +69,17 @@ com.google.cloud google-cloud-network-security - 0.5.1 + 0.5.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-network-security-v1beta1 - 0.5.1 + 0.5.2-SNAPSHOT com.google.api.grpc proto-google-cloud-network-security-v1beta1 - 0.5.1 + 0.5.2-SNAPSHOT diff --git a/proto-google-cloud-network-security-v1beta1/pom.xml b/proto-google-cloud-network-security-v1beta1/pom.xml index d502b469..080727c4 100644 --- a/proto-google-cloud-network-security-v1beta1/pom.xml +++ b/proto-google-cloud-network-security-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-network-security-v1beta1 - 0.5.1 + 0.5.2-SNAPSHOT proto-google-cloud-network-security-v1beta1 Proto library for google-cloud-network-security com.google.cloud google-cloud-network-security-parent - 0.5.1 + 0.5.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index de2a6814..7ab40f88 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-network-security:0.5.1:0.5.1 -grpc-google-cloud-network-security-v1beta1:0.5.1:0.5.1 -proto-google-cloud-network-security-v1beta1:0.5.1:0.5.1 +google-cloud-network-security:0.5.1:0.5.2-SNAPSHOT +grpc-google-cloud-network-security-v1beta1:0.5.1:0.5.2-SNAPSHOT +proto-google-cloud-network-security-v1beta1:0.5.1:0.5.2-SNAPSHOT From d4d33b4e3b2556606e16835b74a27d5ecc0f2823 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Jul 2022 23:08:25 +0200 Subject: [PATCH 02/14] chore(deps): update dependency com.google.cloud:google-cloud-network-security to v0.5.1 (#178) 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-network-security](https://togithub.com/googleapis/java-network-security) | `0.5.0` -> `0.5.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-network-security/0.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-network-security/0.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-network-security/0.5.1/compatibility-slim/0.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-network-security/0.5.1/confidence-slim/0.5.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**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- 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-network-security). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 54c6e313..a22edbea 100644 --- a/README.md +++ b/README.md @@ -22,20 +22,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-network-security - 0.5.0 + 0.5.1 ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-network-security:0.5.0' +implementation 'com.google.cloud:google-cloud-network-security:0.5.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-network-security" % "0.5.0" +libraryDependencies += "com.google.cloud" % "google-cloud-network-security" % "0.5.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 53b4457b..56a23a2b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-network-security - 0.5.0 + 0.5.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6005fdcd..d10a7933 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-network-security - 0.5.0 + 0.5.1 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a3e56ec3..79fc65d2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-network-security - 0.5.0 + 0.5.1 From 84b72e32a581a217570720fb6d7ec7307ddb9a73 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 8 Jul 2022 21:12:41 +0000 Subject: [PATCH 03/14] chore: fix minor typos in README and pom templates (#1479) (#180) Source-Link: https://github.com/googleapis/synthtool/commit/18d4e9bb50d0dfb3291de18c51b96a2c835e2446 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:f8374176dc59291f05dd3fec927a9da2cda687a9ef4de32e77f699a2be12ab45 --- .github/.OwlBot.lock.yaml | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a454a61e..1b645c01 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28 -# created: 2022-06-29T23:17:33.110417661Z + digest: sha256:f8374176dc59291f05dd3fec927a9da2cda687a9ef4de32e77f699a2be12ab45 +# created: 2022-07-07T14:26:11.880812641Z diff --git a/README.md b/README.md index a22edbea..7fed5f1b 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ If you are using Maven, add this to your pom.xml file: ``` -If you are using Gradle without BOM, add this to your dependencies +If you are using Gradle without BOM, add this to your dependencies: ```Groovy implementation 'com.google.cloud:google-cloud-network-security:0.5.1' ``` -If you are using SBT, add this to your dependencies +If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-network-security" % "0.5.1" From 98352f7d9d27a3593cc0909a87d7f41e92d1685f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 12 Jul 2022 02:33:40 +0200 Subject: [PATCH 04/14] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.1 (#179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- google-cloud-network-security-bom/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-network-security-bom/pom.xml b/google-cloud-network-security-bom/pom.xml index d2778f31..e769327a 100644 --- a/google-cloud-network-security-bom/pom.xml +++ b/google-cloud-network-security-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud google-cloud-shared-config - 1.5.0 + 1.5.1 Google Network Security API BOM diff --git a/pom.xml b/pom.xml index f466cc0f..c6648102 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.0 + 1.5.1 From 8a5ce41bc6937989ac7d4c81e733db0cfc83d95f Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:33:48 -0400 Subject: [PATCH 05/14] chore: add native image checks as required (#174) --- .github/sync-repo-settings.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6f09d695..0181fcd5 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -17,6 +17,8 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' - pattern: java7 isAdminEnforced: true requiredApprovingReviewCount: 1 From 47d1104ec950d5c93106821f8bbae8cfcf9e3111 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 13 Jul 2022 19:26:25 +0000 Subject: [PATCH 06/14] fix: enable longpaths support for windows test (#1485) (#181) Source-Link: https://github.com/googleapis/synthtool/commit/73365620c41d96e97ff474b2c4d39b890ad51967 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:d4b80feffe1579818cdc39466152e9de95789a193408506cd4a1ffbe8804dc00 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/workflows/ci.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 1b645c01..de9173d9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:f8374176dc59291f05dd3fec927a9da2cda687a9ef4de32e77f699a2be12ab45 -# created: 2022-07-07T14:26:11.880812641Z + digest: sha256:d4b80feffe1579818cdc39466152e9de95789a193408506cd4a1ffbe8804dc00 +# created: 2022-07-13T13:53:17.676447481Z diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83ef7f9c..e3bb26e3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,6 +39,8 @@ jobs: windows: runs-on: windows-latest steps: + - name: Support longpaths + run: git config --system core.longpaths true - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: From 6ecdb668f65311657fa2a8fe61a0a0f3284e3133 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Jul 2022 17:06:16 +0200 Subject: [PATCH 07/14] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.0 (#184) 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/) ([source](https://togithub.com/apache/maven-project-info-reports-plugin)) | `3.3.0` -> `3.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/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.0/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.0/compatibility-slim/3.3.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.0/confidence-slim/3.3.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-network-security). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c6648102..79606174 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.3.0 + 3.4.0 From 9c37c12219ccad6f1d8a73a54636d9b4a8bd9593 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 17:11:54 -0400 Subject: [PATCH 08/14] feat: publish cloud networksecurity v1 (#183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: publish cloud networksecurity v1 PiperOrigin-RevId: 460770654 Source-Link: https://github.com/googleapis/googleapis/commit/e7edbb9c32ae1e23a94864fc2b838d36ec7210da Source-Link: https://github.com/googleapis/googleapis-gen/commit/1b72bc7f710504bae0e3e6ce6b31bf636a6d2ddd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWI3MmJjN2Y3MTA1MDRiYWUwZTNlNmNlNmIzMWJmNjM2YTZkMmRkZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Remove iam dependency Co-authored-by: Owl Bot Co-authored-by: Lawrence Qiu --- google-cloud-network-security-bom/pom.xml | 10 + google-cloud-network-security/pom.xml | 9 + .../v1/NetworkSecurityClient.java | 2525 +++++ .../v1/NetworkSecuritySettings.java | 505 + .../networksecurity/v1/gapic_metadata.json | 63 + .../networksecurity/v1/package-info.java | 40 + .../GrpcNetworkSecurityCallableFactory.java | 113 + .../v1/stub/GrpcNetworkSecurityStub.java | 860 ++ .../v1/stub/NetworkSecurityStub.java | 207 + .../v1/stub/NetworkSecurityStubSettings.java | 1372 +++ .../v1/MockNetworkSecurity.java | 59 + .../v1/MockNetworkSecurityImpl.java | 379 + .../v1/NetworkSecurityClientTest.java | 1463 +++ grpc-google-cloud-network-security-v1/pom.xml | 69 + .../v1/NetworkSecurityGrpc.java | 2088 ++++ pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 42 + .../v1/AuthorizationPolicy.java | 9033 +++++++++++++++++ .../v1/AuthorizationPolicyName.java | 232 + .../v1/AuthorizationPolicyOrBuilder.java | 321 + .../v1/AuthorizationPolicyProto.java | 283 + .../v1/CertificateProvider.java | 1225 +++ .../v1/CertificateProviderInstance.java | 666 ++ .../CertificateProviderInstanceOrBuilder.java | 54 + .../v1/CertificateProviderOrBuilder.java | 113 + .../networksecurity/v1/ClientTlsPolicy.java | 2842 ++++++ .../v1/ClientTlsPolicyName.java | 227 + .../v1/ClientTlsPolicyOrBuilder.java | 356 + .../v1/ClientTlsPolicyProto.java | 221 + .../cloud/networksecurity/v1/CommonProto.java | 92 + .../v1/CreateAuthorizationPolicyRequest.java | 1181 +++ ...teAuthorizationPolicyRequestOrBuilder.java | 129 + .../v1/CreateClientTlsPolicyRequest.java | 1165 +++ ...CreateClientTlsPolicyRequestOrBuilder.java | 126 + .../v1/CreateServerTlsPolicyRequest.java | 1165 +++ ...CreateServerTlsPolicyRequestOrBuilder.java | 126 + .../v1/DeleteAuthorizationPolicyRequest.java | 672 ++ ...teAuthorizationPolicyRequestOrBuilder.java | 56 + .../v1/DeleteClientTlsPolicyRequest.java | 667 ++ ...DeleteClientTlsPolicyRequestOrBuilder.java | 56 + .../v1/DeleteServerTlsPolicyRequest.java | 667 ++ ...DeleteServerTlsPolicyRequestOrBuilder.java | 56 + .../v1/GetAuthorizationPolicyRequest.java | 669 ++ ...etAuthorizationPolicyRequestOrBuilder.java | 56 + .../v1/GetClientTlsPolicyRequest.java | 664 ++ .../GetClientTlsPolicyRequestOrBuilder.java | 56 + .../v1/GetServerTlsPolicyRequest.java | 664 ++ .../GetServerTlsPolicyRequestOrBuilder.java | 56 + .../networksecurity/v1/GrpcEndpoint.java | 644 ++ .../v1/GrpcEndpointOrBuilder.java | 52 + .../v1/ListAuthorizationPoliciesRequest.java | 969 ++ ...AuthorizationPoliciesRequestOrBuilder.java | 102 + .../v1/ListAuthorizationPoliciesResponse.java | 1227 +++ ...uthorizationPoliciesResponseOrBuilder.java | 113 + .../v1/ListClientTlsPoliciesRequest.java | 957 ++ ...ListClientTlsPoliciesRequestOrBuilder.java | 100 + .../v1/ListClientTlsPoliciesResponse.java | 1191 +++ ...istClientTlsPoliciesResponseOrBuilder.java | 107 + .../v1/ListServerTlsPoliciesRequest.java | 957 ++ ...ListServerTlsPoliciesRequestOrBuilder.java | 100 + .../v1/ListServerTlsPoliciesResponse.java | 1191 +++ ...istServerTlsPoliciesResponseOrBuilder.java | 107 + .../networksecurity/v1/LocationName.java | 192 + .../v1/NetworkSecurityOuterClass.java | 189 + .../networksecurity/v1/OperationMetadata.java | 1851 ++++ .../v1/OperationMetadataOrBuilder.java | 217 + .../networksecurity/v1/ServerTlsPolicy.java | 3566 +++++++ .../v1/ServerTlsPolicyName.java | 227 + .../v1/ServerTlsPolicyOrBuilder.java | 320 + .../v1/ServerTlsPolicyProto.java | 236 + .../cloud/networksecurity/v1/TlsProto.java | 125 + .../v1/UpdateAuthorizationPolicyRequest.java | 1112 ++ ...teAuthorizationPolicyRequestOrBuilder.java | 117 + .../v1/UpdateClientTlsPolicyRequest.java | 1115 ++ ...UpdateClientTlsPolicyRequestOrBuilder.java | 119 + .../v1/UpdateServerTlsPolicyRequest.java | 1115 ++ ...UpdateServerTlsPolicyRequestOrBuilder.java | 119 + .../networksecurity/v1/ValidationCA.java | 1223 +++ .../v1/ValidationCAOrBuilder.java | 113 + .../v1/authorization_policy.proto | 249 + .../v1/client_tls_policy.proto | 160 + .../cloud/networksecurity/v1/common.proto | 55 + .../networksecurity/v1/network_security.proto | 201 + .../v1/server_tls_policy.proto | 181 + .../google/cloud/networksecurity/v1/tls.proto | 78 + .../SyncCreateSetCredentialsProvider.java | 42 + .../create/SyncCreateSetEndpoint.java | 39 + .../AsyncCreateAuthorizationPolicy.java | 52 + .../AsyncCreateAuthorizationPolicyLRO.java | 52 + .../SyncCreateAuthorizationPolicy.java | 48 + ...onpolicynameAuthorizationpolicyString.java | 46 + ...PolicyStringAuthorizationpolicyString.java | 47 + .../AsyncCreateClientTlsPolicy.java | 52 + .../AsyncCreateClientTlsPolicyLRO.java | 52 + .../SyncCreateClientTlsPolicy.java | 47 + ...enttlspolicynameClienttlspolicyString.java | 46 + ...tTlsPolicyStringClienttlspolicyString.java | 45 + .../AsyncCreateServerTlsPolicy.java | 52 + .../AsyncCreateServerTlsPolicyLRO.java | 52 + .../SyncCreateServerTlsPolicy.java | 47 + ...vertlspolicynameServertlspolicyString.java | 46 + ...rTlsPolicyStringServertlspolicyString.java | 45 + .../AsyncDeleteAuthorizationPolicy.java | 49 + .../AsyncDeleteAuthorizationPolicyLRO.java | 50 + .../SyncDeleteAuthorizationPolicy.java | 45 + ...rizationPolicyAuthorizationpolicyname.java | 40 + .../SyncDeleteAuthorizationPolicyString.java | 41 + .../AsyncDeleteClientTlsPolicy.java | 49 + .../AsyncDeleteClientTlsPolicyLRO.java | 50 + .../SyncDeleteClientTlsPolicy.java | 45 + ...eteClientTlsPolicyClienttlspolicyname.java | 40 + .../SyncDeleteClientTlsPolicyString.java | 40 + .../AsyncDeleteServerTlsPolicy.java | 49 + .../AsyncDeleteServerTlsPolicyLRO.java | 50 + .../SyncDeleteServerTlsPolicy.java | 45 + ...eteServerTlsPolicyServertlspolicyname.java | 40 + .../SyncDeleteServerTlsPolicyString.java | 40 + .../AsyncGetAuthorizationPolicy.java | 49 + .../SyncGetAuthorizationPolicy.java | 45 + ...rizationPolicyAuthorizationpolicyname.java | 40 + .../SyncGetAuthorizationPolicyString.java | 41 + .../AsyncGetClientTlsPolicy.java | 49 + .../SyncGetClientTlsPolicy.java | 45 + ...GetClientTlsPolicyClienttlspolicyname.java | 40 + .../SyncGetClientTlsPolicyString.java | 40 + .../AsyncGetServerTlsPolicy.java | 49 + .../SyncGetServerTlsPolicy.java | 45 + ...GetServerTlsPolicyServertlspolicyname.java | 40 + .../SyncGetServerTlsPolicyString.java | 40 + .../AsyncListAuthorizationPolicies.java | 51 + .../AsyncListAuthorizationPoliciesPaged.java | 59 + .../SyncListAuthorizationPolicies.java | 48 + ...ListAuthorizationPoliciesLocationname.java | 42 + .../SyncListAuthorizationPoliciesString.java | 42 + .../AsyncListClientTlsPolicies.java | 51 + .../AsyncListClientTlsPoliciesPaged.java | 59 + .../SyncListClientTlsPolicies.java | 48 + ...SyncListClientTlsPoliciesLocationname.java | 42 + .../SyncListClientTlsPoliciesString.java | 42 + .../AsyncListServerTlsPolicies.java | 51 + .../AsyncListServerTlsPoliciesPaged.java | 59 + .../SyncListServerTlsPolicies.java | 48 + ...SyncListServerTlsPoliciesLocationname.java | 42 + .../SyncListServerTlsPoliciesString.java | 42 + .../AsyncUpdateAuthorizationPolicy.java | 49 + .../AsyncUpdateAuthorizationPolicyLRO.java | 49 + .../SyncUpdateAuthorizationPolicy.java | 45 + ...ionPolicyAuthorizationpolicyFieldmask.java | 43 + .../AsyncUpdateClientTlsPolicy.java | 49 + .../AsyncUpdateClientTlsPolicyLRO.java | 49 + .../SyncUpdateClientTlsPolicy.java | 44 + ...ientTlsPolicyClienttlspolicyFieldmask.java | 41 + .../AsyncUpdateServerTlsPolicy.java | 49 + .../AsyncUpdateServerTlsPolicyLRO.java | 49 + .../SyncUpdateServerTlsPolicy.java | 44 + ...rverTlsPolicyServertlspolicyFieldmask.java | 41 + .../SyncGetAuthorizationPolicy.java | 46 + .../SyncGetAuthorizationPolicy.java | 46 + versions.txt | 2 + 160 files changed, 57806 insertions(+) create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityClient.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecuritySettings.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/gapic_metadata.json create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/package-info.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityCallableFactory.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityStub.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStub.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStubSettings.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurity.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurityImpl.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/NetworkSecurityClientTest.java create mode 100644 grpc-google-cloud-network-security-v1/pom.xml create mode 100644 grpc-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityGrpc.java create mode 100644 proto-google-cloud-network-security-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-network-security-v1/pom.xml create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicy.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyName.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyProto.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProvider.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstance.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstanceOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicy.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyName.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyProto.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CommonProto.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpoint.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpointOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponse.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponseOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponse.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponseOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponse.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponseOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/LocationName.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityOuterClass.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadata.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicy.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyName.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyProto.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/TlsProto.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequest.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequestOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCA.java create mode 100644 proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCAOrBuilder.java create mode 100644 proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/authorization_policy.proto create mode 100644 proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/client_tls_policy.proto create mode 100644 proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/common.proto create mode 100644 proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/network_security.proto create mode 100644 proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/server_tls_policy.proto create mode 100644 proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/tls.proto create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetEndpoint.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyAuthorizationpolicyname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyClienttlspolicyname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyServertlspolicyname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/AsyncGetAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyAuthorizationpolicyname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/AsyncGetClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyClienttlspolicyname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/AsyncGetServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyServertlspolicyname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPolicies.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPoliciesPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPolicies.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPolicies.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPoliciesPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPolicies.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPolicies.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPoliciesPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPolicies.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesString.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicyClienttlspolicyFieldmask.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicyLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicyServertlspolicyFieldmask.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecuritysettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/stub/networksecuritystubsettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java diff --git a/google-cloud-network-security-bom/pom.xml b/google-cloud-network-security-bom/pom.xml index e769327a..1ee47568 100644 --- a/google-cloud-network-security-bom/pom.xml +++ b/google-cloud-network-security-bom/pom.xml @@ -63,11 +63,21 @@ grpc-google-cloud-network-security-v1beta1 0.5.2-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-network-security-v1 + 0.5.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-network-security-v1beta1 0.5.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-network-security-v1 + 0.5.2-SNAPSHOT + diff --git a/google-cloud-network-security/pom.xml b/google-cloud-network-security/pom.xml index dc28a3ec..cc6852d4 100644 --- a/google-cloud-network-security/pom.xml +++ b/google-cloud-network-security/pom.xml @@ -42,6 +42,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-network-security-v1 + com.google.api.grpc proto-google-cloud-network-security-v1beta1 @@ -76,6 +80,11 @@ grpc-google-cloud-network-security-v1beta1 test + + com.google.api.grpc + grpc-google-cloud-network-security-v1 + test + com.google.api diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityClient.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityClient.java new file mode 100644 index 00000000..0a1fe58f --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityClient.java @@ -0,0 +1,2525 @@ +/* + * 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.cloud.networksecurity.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +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.cloud.networksecurity.v1.stub.NetworkSecurityStub; +import com.google.cloud.networksecurity.v1.stub.NetworkSecurityStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Network Security API provides resources to configure authentication and + * authorization policies. Refer to per API resource documentation for more information. + * + *

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 for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+ *   AuthorizationPolicyName name =
+ *       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
+ *   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the NetworkSecurityClient 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 NetworkSecuritySettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * NetworkSecuritySettings networkSecuritySettings =
+ *     NetworkSecuritySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * NetworkSecurityClient networkSecurityClient =
+ *     NetworkSecurityClient.create(networkSecuritySettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * NetworkSecuritySettings networkSecuritySettings =
+ *     NetworkSecuritySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NetworkSecurityClient networkSecurityClient =
+ *     NetworkSecurityClient.create(networkSecuritySettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class NetworkSecurityClient implements BackgroundResource { + private final NetworkSecuritySettings settings; + private final NetworkSecurityStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of NetworkSecurityClient with default settings. */ + public static final NetworkSecurityClient create() throws IOException { + return create(NetworkSecuritySettings.newBuilder().build()); + } + + /** + * Constructs an instance of NetworkSecurityClient, 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 NetworkSecurityClient create(NetworkSecuritySettings settings) + throws IOException { + return new NetworkSecurityClient(settings); + } + + /** + * Constructs an instance of NetworkSecurityClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(NetworkSecuritySettings). + */ + public static final NetworkSecurityClient create(NetworkSecurityStub stub) { + return new NetworkSecurityClient(stub); + } + + /** + * Constructs an instance of NetworkSecurityClient, 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 NetworkSecurityClient(NetworkSecuritySettings settings) throws IOException { + this.settings = settings; + this.stub = ((NetworkSecurityStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected NetworkSecurityClient(NetworkSecurityStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final NetworkSecuritySettings getSettings() { + return settings; + } + + public NetworkSecurityStub 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 OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AuthorizationPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (AuthorizationPolicy element :
+   *       networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the AuthorizationPolicies should be + * listed, specified in the format `projects/{project}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies( + LocationName parent) { + ListAuthorizationPoliciesRequest request = + ListAuthorizationPoliciesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAuthorizationPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AuthorizationPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (AuthorizationPolicy element :
+   *       networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the AuthorizationPolicies should be + * listed, specified in the format `projects/{project}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies(String parent) { + ListAuthorizationPoliciesRequest request = + ListAuthorizationPoliciesRequest.newBuilder().setParent(parent).build(); + return listAuthorizationPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AuthorizationPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListAuthorizationPoliciesRequest request =
+   *       ListAuthorizationPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AuthorizationPolicy element :
+   *       networkSecurityClient.listAuthorizationPolicies(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 ListAuthorizationPoliciesPagedResponse listAuthorizationPolicies( + ListAuthorizationPoliciesRequest request) { + return listAuthorizationPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AuthorizationPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListAuthorizationPoliciesRequest request =
+   *       ListAuthorizationPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.listAuthorizationPoliciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AuthorizationPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesPagedCallable() { + return stub.listAuthorizationPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AuthorizationPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListAuthorizationPoliciesRequest request =
+   *       ListAuthorizationPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListAuthorizationPoliciesResponse response =
+   *         networkSecurityClient.listAuthorizationPoliciesCallable().call(request);
+   *     for (AuthorizationPolicy element : response.getAuthorizationPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAuthorizationPoliciesCallable() { + return stub.listAuthorizationPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   AuthorizationPolicyName name =
+   *       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
+   *   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
+   * }
+   * }
+ * + * @param name Required. A name of the AuthorizationPolicy to get. Must be in the format + * `projects/{project}/locations/{location}/authorizationPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AuthorizationPolicy getAuthorizationPolicy(AuthorizationPolicyName name) { + GetAuthorizationPolicyRequest request = + GetAuthorizationPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAuthorizationPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String name =
+   *       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *           .toString();
+   *   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
+   * }
+   * }
+ * + * @param name Required. A name of the AuthorizationPolicy to get. Must be in the format + * `projects/{project}/locations/{location}/authorizationPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AuthorizationPolicy getAuthorizationPolicy(String name) { + GetAuthorizationPolicyRequest request = + GetAuthorizationPolicyRequest.newBuilder().setName(name).build(); + return getAuthorizationPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetAuthorizationPolicyRequest request =
+   *       GetAuthorizationPolicyRequest.newBuilder()
+   *           .setName(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(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 AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRequest request) { + return getAuthorizationPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetAuthorizationPolicyRequest request =
+   *       GetAuthorizationPolicyRequest.newBuilder()
+   *           .setName(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.getAuthorizationPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizationPolicy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getAuthorizationPolicyCallable() { + return stub.getAuthorizationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizationPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build();
+   *   String authorizationPolicyId = "authorizationPolicyId1314252166";
+   *   AuthorizationPolicy response =
+   *       networkSecurityClient
+   *           .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource of the AuthorizationPolicy. Must be in the format + * `projects/{project}/locations/{location}`. + * @param authorizationPolicy Required. AuthorizationPolicy resource to be created. + * @param authorizationPolicyId Required. Short name of the AuthorizationPolicy resource to be + * created. This value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. "authz_policy". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAuthorizationPolicyAsync( + LocationName parent, + AuthorizationPolicy authorizationPolicy, + String authorizationPolicyId) { + CreateAuthorizationPolicyRequest request = + CreateAuthorizationPolicyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAuthorizationPolicy(authorizationPolicy) + .setAuthorizationPolicyId(authorizationPolicyId) + .build(); + return createAuthorizationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizationPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build();
+   *   String authorizationPolicyId = "authorizationPolicyId1314252166";
+   *   AuthorizationPolicy response =
+   *       networkSecurityClient
+   *           .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource of the AuthorizationPolicy. Must be in the format + * `projects/{project}/locations/{location}`. + * @param authorizationPolicy Required. AuthorizationPolicy resource to be created. + * @param authorizationPolicyId Required. Short name of the AuthorizationPolicy resource to be + * created. This value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. "authz_policy". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + createAuthorizationPolicyAsync( + String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId) { + CreateAuthorizationPolicyRequest request = + CreateAuthorizationPolicyRequest.newBuilder() + .setParent(parent) + .setAuthorizationPolicy(authorizationPolicy) + .setAuthorizationPolicyId(authorizationPolicyId) + .build(); + return createAuthorizationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizationPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateAuthorizationPolicyRequest request =
+   *       CreateAuthorizationPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAuthorizationPolicyId("authorizationPolicyId1314252166")
+   *           .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
+   *           .build();
+   *   AuthorizationPolicy response =
+   *       networkSecurityClient.createAuthorizationPolicyAsync(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 + createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequest request) { + return createAuthorizationPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizationPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateAuthorizationPolicyRequest request =
+   *       CreateAuthorizationPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAuthorizationPolicyId("authorizationPolicyId1314252166")
+   *           .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.createAuthorizationPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizationPolicy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationCallable() { + return stub.createAuthorizationPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AuthorizationPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateAuthorizationPolicyRequest request =
+   *       CreateAuthorizationPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAuthorizationPolicyId("authorizationPolicyId1314252166")
+   *           .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.createAuthorizationPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createAuthorizationPolicyCallable() { + return stub.createAuthorizationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AuthorizationPolicy response =
+   *       networkSecurityClient
+   *           .updateAuthorizationPolicyAsync(authorizationPolicy, updateMask)
+   *           .get();
+   * }
+   * }
+ * + * @param authorizationPolicy Required. Updated AuthorizationPolicy resource. + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * AuthorizationPolicy resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + updateAuthorizationPolicyAsync( + AuthorizationPolicy authorizationPolicy, FieldMask updateMask) { + UpdateAuthorizationPolicyRequest request = + UpdateAuthorizationPolicyRequest.newBuilder() + .setAuthorizationPolicy(authorizationPolicy) + .setUpdateMask(updateMask) + .build(); + return updateAuthorizationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateAuthorizationPolicyRequest request =
+   *       UpdateAuthorizationPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
+   *           .build();
+   *   AuthorizationPolicy response =
+   *       networkSecurityClient.updateAuthorizationPolicyAsync(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 + updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequest request) { + return updateAuthorizationPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateAuthorizationPolicyRequest request =
+   *       UpdateAuthorizationPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.updateAuthorizationPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizationPolicy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationCallable() { + return stub.updateAuthorizationPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateAuthorizationPolicyRequest request =
+   *       UpdateAuthorizationPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.updateAuthorizationPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateAuthorizationPolicyCallable() { + return stub.updateAuthorizationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   AuthorizationPolicyName name =
+   *       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
+   *   networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the AuthorizationPolicy to delete. Must be in the format + * `projects/{project}/locations/{location}/authorizationPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAuthorizationPolicyAsync( + AuthorizationPolicyName name) { + DeleteAuthorizationPolicyRequest request = + DeleteAuthorizationPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteAuthorizationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String name =
+   *       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *           .toString();
+   *   networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the AuthorizationPolicy to delete. Must be in the format + * `projects/{project}/locations/{location}/authorizationPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAuthorizationPolicyAsync( + String name) { + DeleteAuthorizationPolicyRequest request = + DeleteAuthorizationPolicyRequest.newBuilder().setName(name).build(); + return deleteAuthorizationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteAuthorizationPolicyRequest request =
+   *       DeleteAuthorizationPolicyRequest.newBuilder()
+   *           .setName(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   networkSecurityClient.deleteAuthorizationPolicyAsync(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 deleteAuthorizationPolicyAsync( + DeleteAuthorizationPolicyRequest request) { + return deleteAuthorizationPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteAuthorizationPolicyRequest request =
+   *       DeleteAuthorizationPolicyRequest.newBuilder()
+   *           .setName(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.deleteAuthorizationPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteAuthorizationPolicyOperationCallable() { + return stub.deleteAuthorizationPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AuthorizationPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteAuthorizationPolicyRequest request =
+   *       DeleteAuthorizationPolicyRequest.newBuilder()
+   *           .setName(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.deleteAuthorizationPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteAuthorizationPolicyCallable() { + return stub.deleteAuthorizationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ServerTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ServerTlsPolicy element :
+   *       networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the ServerTlsPolicies should be + * listed, specified in the format `projects/*/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServerTlsPoliciesPagedResponse listServerTlsPolicies(LocationName parent) { + ListServerTlsPoliciesRequest request = + ListServerTlsPoliciesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listServerTlsPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ServerTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ServerTlsPolicy element :
+   *       networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the ServerTlsPolicies should be + * listed, specified in the format `projects/*/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServerTlsPoliciesPagedResponse listServerTlsPolicies(String parent) { + ListServerTlsPoliciesRequest request = + ListServerTlsPoliciesRequest.newBuilder().setParent(parent).build(); + return listServerTlsPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ServerTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListServerTlsPoliciesRequest request =
+   *       ListServerTlsPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ServerTlsPolicy element :
+   *       networkSecurityClient.listServerTlsPolicies(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 ListServerTlsPoliciesPagedResponse listServerTlsPolicies( + ListServerTlsPoliciesRequest request) { + return listServerTlsPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ServerTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListServerTlsPoliciesRequest request =
+   *       ListServerTlsPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.listServerTlsPoliciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ServerTlsPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listServerTlsPoliciesPagedCallable() { + return stub.listServerTlsPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ServerTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListServerTlsPoliciesRequest request =
+   *       ListServerTlsPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListServerTlsPoliciesResponse response =
+   *         networkSecurityClient.listServerTlsPoliciesCallable().call(request);
+   *     for (ServerTlsPolicy element : response.getServerTlsPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listServerTlsPoliciesCallable() { + return stub.listServerTlsPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ServerTlsPolicyName name =
+   *       ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]");
+   *   ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name);
+   * }
+   * }
+ * + * @param name Required. A name of the ServerTlsPolicy to get. Must be in the format + * `projects/*/locations/{location}/serverTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServerTlsPolicy getServerTlsPolicy(ServerTlsPolicyName name) { + GetServerTlsPolicyRequest request = + GetServerTlsPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getServerTlsPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String name =
+   *       ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString();
+   *   ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name);
+   * }
+   * }
+ * + * @param name Required. A name of the ServerTlsPolicy to get. Must be in the format + * `projects/*/locations/{location}/serverTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ServerTlsPolicy getServerTlsPolicy(String name) { + GetServerTlsPolicyRequest request = + GetServerTlsPolicyRequest.newBuilder().setName(name).build(); + return getServerTlsPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetServerTlsPolicyRequest request =
+   *       GetServerTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(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 ServerTlsPolicy getServerTlsPolicy(GetServerTlsPolicyRequest request) { + return getServerTlsPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetServerTlsPolicyRequest request =
+   *       GetServerTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.getServerTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   ServerTlsPolicy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getServerTlsPolicyCallable() { + return stub.getServerTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ServerTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build();
+   *   String serverTlsPolicyId = "serverTlsPolicyId-1966046011";
+   *   ServerTlsPolicy response =
+   *       networkSecurityClient
+   *           .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource of the ServerTlsPolicy. Must be in the format + * `projects/*/locations/{location}`. + * @param serverTlsPolicy Required. ServerTlsPolicy resource to be created. + * @param serverTlsPolicyId Required. Short name of the ServerTlsPolicy resource to be created. + * This value should be 1-63 characters long, containing only letters, numbers, hyphens, and + * underscores, and should not start with a number. E.g. "server_mtls_policy". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createServerTlsPolicyAsync( + LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) { + CreateServerTlsPolicyRequest request = + CreateServerTlsPolicyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setServerTlsPolicy(serverTlsPolicy) + .setServerTlsPolicyId(serverTlsPolicyId) + .build(); + return createServerTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ServerTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build();
+   *   String serverTlsPolicyId = "serverTlsPolicyId-1966046011";
+   *   ServerTlsPolicy response =
+   *       networkSecurityClient
+   *           .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource of the ServerTlsPolicy. Must be in the format + * `projects/*/locations/{location}`. + * @param serverTlsPolicy Required. ServerTlsPolicy resource to be created. + * @param serverTlsPolicyId Required. Short name of the ServerTlsPolicy resource to be created. + * This value should be 1-63 characters long, containing only letters, numbers, hyphens, and + * underscores, and should not start with a number. E.g. "server_mtls_policy". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createServerTlsPolicyAsync( + String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) { + CreateServerTlsPolicyRequest request = + CreateServerTlsPolicyRequest.newBuilder() + .setParent(parent) + .setServerTlsPolicy(serverTlsPolicy) + .setServerTlsPolicyId(serverTlsPolicyId) + .build(); + return createServerTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ServerTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateServerTlsPolicyRequest request =
+   *       CreateServerTlsPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setServerTlsPolicyId("serverTlsPolicyId-1966046011")
+   *           .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ServerTlsPolicy response = networkSecurityClient.createServerTlsPolicyAsync(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 createServerTlsPolicyAsync( + CreateServerTlsPolicyRequest request) { + return createServerTlsPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ServerTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateServerTlsPolicyRequest request =
+   *       CreateServerTlsPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setServerTlsPolicyId("serverTlsPolicyId-1966046011")
+   *           .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.createServerTlsPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ServerTlsPolicy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createServerTlsPolicyOperationCallable() { + return stub.createServerTlsPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ServerTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateServerTlsPolicyRequest request =
+   *       CreateServerTlsPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setServerTlsPolicyId("serverTlsPolicyId-1966046011")
+   *           .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.createServerTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createServerTlsPolicyCallable() { + return stub.createServerTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ServerTlsPolicy response =
+   *       networkSecurityClient.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).get();
+   * }
+   * }
+ * + * @param serverTlsPolicy Required. Updated ServerTlsPolicy resource. + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * ServerTlsPolicy resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateServerTlsPolicyAsync( + ServerTlsPolicy serverTlsPolicy, FieldMask updateMask) { + UpdateServerTlsPolicyRequest request = + UpdateServerTlsPolicyRequest.newBuilder() + .setServerTlsPolicy(serverTlsPolicy) + .setUpdateMask(updateMask) + .build(); + return updateServerTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateServerTlsPolicyRequest request =
+   *       UpdateServerTlsPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ServerTlsPolicy response = networkSecurityClient.updateServerTlsPolicyAsync(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 updateServerTlsPolicyAsync( + UpdateServerTlsPolicyRequest request) { + return updateServerTlsPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateServerTlsPolicyRequest request =
+   *       UpdateServerTlsPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.updateServerTlsPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ServerTlsPolicy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateServerTlsPolicyOperationCallable() { + return stub.updateServerTlsPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateServerTlsPolicyRequest request =
+   *       UpdateServerTlsPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.updateServerTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateServerTlsPolicyCallable() { + return stub.updateServerTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ServerTlsPolicyName name =
+   *       ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]");
+   *   networkSecurityClient.deleteServerTlsPolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the ServerTlsPolicy to delete. Must be in the format + * `projects/*/locations/{location}/serverTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteServerTlsPolicyAsync( + ServerTlsPolicyName name) { + DeleteServerTlsPolicyRequest request = + DeleteServerTlsPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteServerTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String name =
+   *       ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString();
+   *   networkSecurityClient.deleteServerTlsPolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the ServerTlsPolicy to delete. Must be in the format + * `projects/*/locations/{location}/serverTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteServerTlsPolicyAsync(String name) { + DeleteServerTlsPolicyRequest request = + DeleteServerTlsPolicyRequest.newBuilder().setName(name).build(); + return deleteServerTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteServerTlsPolicyRequest request =
+   *       DeleteServerTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   networkSecurityClient.deleteServerTlsPolicyAsync(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 deleteServerTlsPolicyAsync( + DeleteServerTlsPolicyRequest request) { + return deleteServerTlsPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteServerTlsPolicyRequest request =
+   *       DeleteServerTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.deleteServerTlsPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteServerTlsPolicyOperationCallable() { + return stub.deleteServerTlsPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ServerTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteServerTlsPolicyRequest request =
+   *       DeleteServerTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.deleteServerTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteServerTlsPolicyCallable() { + return stub.deleteServerTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ClientTlsPolicy element :
+   *       networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the ClientTlsPolicies should be + * listed, specified in the format `projects/*/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClientTlsPoliciesPagedResponse listClientTlsPolicies(LocationName parent) { + ListClientTlsPoliciesRequest request = + ListClientTlsPoliciesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listClientTlsPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ClientTlsPolicy element :
+   *       networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the ClientTlsPolicies should be + * listed, specified in the format `projects/*/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListClientTlsPoliciesPagedResponse listClientTlsPolicies(String parent) { + ListClientTlsPoliciesRequest request = + ListClientTlsPoliciesRequest.newBuilder().setParent(parent).build(); + return listClientTlsPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListClientTlsPoliciesRequest request =
+   *       ListClientTlsPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ClientTlsPolicy element :
+   *       networkSecurityClient.listClientTlsPolicies(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 ListClientTlsPoliciesPagedResponse listClientTlsPolicies( + ListClientTlsPoliciesRequest request) { + return listClientTlsPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListClientTlsPoliciesRequest request =
+   *       ListClientTlsPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.listClientTlsPoliciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ClientTlsPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClientTlsPoliciesPagedCallable() { + return stub.listClientTlsPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ClientTlsPolicies in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListClientTlsPoliciesRequest request =
+   *       ListClientTlsPoliciesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListClientTlsPoliciesResponse response =
+   *         networkSecurityClient.listClientTlsPoliciesCallable().call(request);
+   *     for (ClientTlsPolicy element : response.getClientTlsPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listClientTlsPoliciesCallable() { + return stub.listClientTlsPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ClientTlsPolicyName name =
+   *       ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]");
+   *   ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name);
+   * }
+   * }
+ * + * @param name Required. A name of the ClientTlsPolicy to get. Must be in the format + * `projects/*/locations/{location}/clientTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ClientTlsPolicy getClientTlsPolicy(ClientTlsPolicyName name) { + GetClientTlsPolicyRequest request = + GetClientTlsPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getClientTlsPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String name =
+   *       ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString();
+   *   ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name);
+   * }
+   * }
+ * + * @param name Required. A name of the ClientTlsPolicy to get. Must be in the format + * `projects/*/locations/{location}/clientTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ClientTlsPolicy getClientTlsPolicy(String name) { + GetClientTlsPolicyRequest request = + GetClientTlsPolicyRequest.newBuilder().setName(name).build(); + return getClientTlsPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetClientTlsPolicyRequest request =
+   *       GetClientTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(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 ClientTlsPolicy getClientTlsPolicy(GetClientTlsPolicyRequest request) { + return getClientTlsPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetClientTlsPolicyRequest request =
+   *       GetClientTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.getClientTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   ClientTlsPolicy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getClientTlsPolicyCallable() { + return stub.getClientTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build();
+   *   String clientTlsPolicyId = "clientTlsPolicyId-188933315";
+   *   ClientTlsPolicy response =
+   *       networkSecurityClient
+   *           .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource of the ClientTlsPolicy. Must be in the format + * `projects/*/locations/{location}`. + * @param clientTlsPolicy Required. ClientTlsPolicy resource to be created. + * @param clientTlsPolicyId Required. Short name of the ClientTlsPolicy resource to be created. + * This value should be 1-63 characters long, containing only letters, numbers, hyphens, and + * underscores, and should not start with a number. E.g. "client_mtls_policy". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClientTlsPolicyAsync( + LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) { + CreateClientTlsPolicyRequest request = + CreateClientTlsPolicyRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setClientTlsPolicy(clientTlsPolicy) + .setClientTlsPolicyId(clientTlsPolicyId) + .build(); + return createClientTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build();
+   *   String clientTlsPolicyId = "clientTlsPolicyId-188933315";
+   *   ClientTlsPolicy response =
+   *       networkSecurityClient
+   *           .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource of the ClientTlsPolicy. Must be in the format + * `projects/*/locations/{location}`. + * @param clientTlsPolicy Required. ClientTlsPolicy resource to be created. + * @param clientTlsPolicyId Required. Short name of the ClientTlsPolicy resource to be created. + * This value should be 1-63 characters long, containing only letters, numbers, hyphens, and + * underscores, and should not start with a number. E.g. "client_mtls_policy". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createClientTlsPolicyAsync( + String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) { + CreateClientTlsPolicyRequest request = + CreateClientTlsPolicyRequest.newBuilder() + .setParent(parent) + .setClientTlsPolicy(clientTlsPolicy) + .setClientTlsPolicyId(clientTlsPolicyId) + .build(); + return createClientTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateClientTlsPolicyRequest request =
+   *       CreateClientTlsPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClientTlsPolicyId("clientTlsPolicyId-188933315")
+   *           .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ClientTlsPolicy response = networkSecurityClient.createClientTlsPolicyAsync(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 createClientTlsPolicyAsync( + CreateClientTlsPolicyRequest request) { + return createClientTlsPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateClientTlsPolicyRequest request =
+   *       CreateClientTlsPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClientTlsPolicyId("clientTlsPolicyId-188933315")
+   *           .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.createClientTlsPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ClientTlsPolicy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClientTlsPolicyOperationCallable() { + return stub.createClientTlsPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ClientTlsPolicy in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   CreateClientTlsPolicyRequest request =
+   *       CreateClientTlsPolicyRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClientTlsPolicyId("clientTlsPolicyId-188933315")
+   *           .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.createClientTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createClientTlsPolicyCallable() { + return stub.createClientTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ClientTlsPolicy response =
+   *       networkSecurityClient.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).get();
+   * }
+   * }
+ * + * @param clientTlsPolicy Required. Updated ClientTlsPolicy resource. + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * ClientTlsPolicy resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateClientTlsPolicyAsync( + ClientTlsPolicy clientTlsPolicy, FieldMask updateMask) { + UpdateClientTlsPolicyRequest request = + UpdateClientTlsPolicyRequest.newBuilder() + .setClientTlsPolicy(clientTlsPolicy) + .setUpdateMask(updateMask) + .build(); + return updateClientTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateClientTlsPolicyRequest request =
+   *       UpdateClientTlsPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ClientTlsPolicy response = networkSecurityClient.updateClientTlsPolicyAsync(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 updateClientTlsPolicyAsync( + UpdateClientTlsPolicyRequest request) { + return updateClientTlsPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateClientTlsPolicyRequest request =
+   *       UpdateClientTlsPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.updateClientTlsPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ClientTlsPolicy response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClientTlsPolicyOperationCallable() { + return stub.updateClientTlsPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   UpdateClientTlsPolicyRequest request =
+   *       UpdateClientTlsPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.updateClientTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateClientTlsPolicyCallable() { + return stub.updateClientTlsPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ClientTlsPolicyName name =
+   *       ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]");
+   *   networkSecurityClient.deleteClientTlsPolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the ClientTlsPolicy to delete. Must be in the format + * `projects/*/locations/{location}/clientTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClientTlsPolicyAsync( + ClientTlsPolicyName name) { + DeleteClientTlsPolicyRequest request = + DeleteClientTlsPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deleteClientTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   String name =
+   *       ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString();
+   *   networkSecurityClient.deleteClientTlsPolicyAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the ClientTlsPolicy to delete. Must be in the format + * `projects/*/locations/{location}/clientTlsPolicies/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteClientTlsPolicyAsync(String name) { + DeleteClientTlsPolicyRequest request = + DeleteClientTlsPolicyRequest.newBuilder().setName(name).build(); + return deleteClientTlsPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteClientTlsPolicyRequest request =
+   *       DeleteClientTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   networkSecurityClient.deleteClientTlsPolicyAsync(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 deleteClientTlsPolicyAsync( + DeleteClientTlsPolicyRequest request) { + return deleteClientTlsPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteClientTlsPolicyRequest request =
+   *       DeleteClientTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       networkSecurityClient.deleteClientTlsPolicyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteClientTlsPolicyOperationCallable() { + return stub.deleteClientTlsPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ClientTlsPolicy. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   DeleteClientTlsPolicyRequest request =
+   *       DeleteClientTlsPolicyRequest.newBuilder()
+   *           .setName(
+   *               ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.deleteClientTlsPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteClientTlsPolicyCallable() { + return stub.deleteClientTlsPolicyCallable(); + } + + @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 ListAuthorizationPoliciesPagedResponse + extends AbstractPagedListResponse< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy, + ListAuthorizationPoliciesPage, + ListAuthorizationPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAuthorizationPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAuthorizationPoliciesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAuthorizationPoliciesPagedResponse(ListAuthorizationPoliciesPage page) { + super(page, ListAuthorizationPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAuthorizationPoliciesPage + extends AbstractPage< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy, + ListAuthorizationPoliciesPage> { + + private ListAuthorizationPoliciesPage( + PageContext< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy> + context, + ListAuthorizationPoliciesResponse response) { + super(context, response); + } + + private static ListAuthorizationPoliciesPage createEmptyPage() { + return new ListAuthorizationPoliciesPage(null, null); + } + + @Override + protected ListAuthorizationPoliciesPage createPage( + PageContext< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy> + context, + ListAuthorizationPoliciesResponse response) { + return new ListAuthorizationPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAuthorizationPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy, + ListAuthorizationPoliciesPage, + ListAuthorizationPoliciesFixedSizeCollection> { + + private ListAuthorizationPoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAuthorizationPoliciesFixedSizeCollection createEmptyCollection() { + return new ListAuthorizationPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListAuthorizationPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAuthorizationPoliciesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListServerTlsPoliciesPagedResponse + extends AbstractPagedListResponse< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ServerTlsPolicy, + ListServerTlsPoliciesPage, + ListServerTlsPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListServerTlsPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListServerTlsPoliciesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListServerTlsPoliciesPagedResponse(ListServerTlsPoliciesPage page) { + super(page, ListServerTlsPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListServerTlsPoliciesPage + extends AbstractPage< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ServerTlsPolicy, + ListServerTlsPoliciesPage> { + + private ListServerTlsPoliciesPage( + PageContext + context, + ListServerTlsPoliciesResponse response) { + super(context, response); + } + + private static ListServerTlsPoliciesPage createEmptyPage() { + return new ListServerTlsPoliciesPage(null, null); + } + + @Override + protected ListServerTlsPoliciesPage createPage( + PageContext + context, + ListServerTlsPoliciesResponse response) { + return new ListServerTlsPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListServerTlsPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ServerTlsPolicy, + ListServerTlsPoliciesPage, + ListServerTlsPoliciesFixedSizeCollection> { + + private ListServerTlsPoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListServerTlsPoliciesFixedSizeCollection createEmptyCollection() { + return new ListServerTlsPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListServerTlsPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListServerTlsPoliciesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListClientTlsPoliciesPagedResponse + extends AbstractPagedListResponse< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ClientTlsPolicy, + ListClientTlsPoliciesPage, + ListClientTlsPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListClientTlsPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListClientTlsPoliciesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListClientTlsPoliciesPagedResponse(ListClientTlsPoliciesPage page) { + super(page, ListClientTlsPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListClientTlsPoliciesPage + extends AbstractPage< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ClientTlsPolicy, + ListClientTlsPoliciesPage> { + + private ListClientTlsPoliciesPage( + PageContext + context, + ListClientTlsPoliciesResponse response) { + super(context, response); + } + + private static ListClientTlsPoliciesPage createEmptyPage() { + return new ListClientTlsPoliciesPage(null, null); + } + + @Override + protected ListClientTlsPoliciesPage createPage( + PageContext + context, + ListClientTlsPoliciesResponse response) { + return new ListClientTlsPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListClientTlsPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ClientTlsPolicy, + ListClientTlsPoliciesPage, + ListClientTlsPoliciesFixedSizeCollection> { + + private ListClientTlsPoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListClientTlsPoliciesFixedSizeCollection createEmptyCollection() { + return new ListClientTlsPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListClientTlsPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListClientTlsPoliciesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecuritySettings.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecuritySettings.java new file mode 100644 index 00000000..5dce47f8 --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecuritySettings.java @@ -0,0 +1,505 @@ +/* + * 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.cloud.networksecurity.v1; + +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +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.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.cloud.networksecurity.v1.stub.NetworkSecurityStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 NetworkSecurityClient}. + * + *

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

    + *
  • The default service address (networksecurity.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 getAuthorizationPolicy to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * NetworkSecuritySettings.Builder networkSecuritySettingsBuilder =
+ *     NetworkSecuritySettings.newBuilder();
+ * networkSecuritySettingsBuilder
+ *     .getAuthorizationPolicySettings()
+ *     .setRetrySettings(
+ *         networkSecuritySettingsBuilder
+ *             .getAuthorizationPolicySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * NetworkSecuritySettings networkSecuritySettings = networkSecuritySettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class NetworkSecuritySettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listAuthorizationPolicies. */ + public PagedCallSettings< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).listAuthorizationPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to getAuthorizationPolicy. */ + public UnaryCallSettings + getAuthorizationPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).getAuthorizationPolicySettings(); + } + + /** Returns the object with the settings used for calls to createAuthorizationPolicy. */ + public UnaryCallSettings + createAuthorizationPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).createAuthorizationPolicySettings(); + } + + /** Returns the object with the settings used for calls to createAuthorizationPolicy. */ + public OperationCallSettings< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .createAuthorizationPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateAuthorizationPolicy. */ + public UnaryCallSettings + updateAuthorizationPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).updateAuthorizationPolicySettings(); + } + + /** Returns the object with the settings used for calls to updateAuthorizationPolicy. */ + public OperationCallSettings< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .updateAuthorizationPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteAuthorizationPolicy. */ + public UnaryCallSettings + deleteAuthorizationPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).deleteAuthorizationPolicySettings(); + } + + /** Returns the object with the settings used for calls to deleteAuthorizationPolicy. */ + public OperationCallSettings + deleteAuthorizationPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .deleteAuthorizationPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to listServerTlsPolicies. */ + public PagedCallSettings< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + listServerTlsPoliciesSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).listServerTlsPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to getServerTlsPolicy. */ + public UnaryCallSettings + getServerTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).getServerTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to createServerTlsPolicy. */ + public UnaryCallSettings + createServerTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).createServerTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to createServerTlsPolicy. */ + public OperationCallSettings + createServerTlsPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .createServerTlsPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateServerTlsPolicy. */ + public UnaryCallSettings + updateServerTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).updateServerTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to updateServerTlsPolicy. */ + public OperationCallSettings + updateServerTlsPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .updateServerTlsPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteServerTlsPolicy. */ + public UnaryCallSettings + deleteServerTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).deleteServerTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to deleteServerTlsPolicy. */ + public OperationCallSettings + deleteServerTlsPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .deleteServerTlsPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to listClientTlsPolicies. */ + public PagedCallSettings< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + listClientTlsPoliciesSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).listClientTlsPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to getClientTlsPolicy. */ + public UnaryCallSettings + getClientTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).getClientTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to createClientTlsPolicy. */ + public UnaryCallSettings + createClientTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).createClientTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to createClientTlsPolicy. */ + public OperationCallSettings + createClientTlsPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .createClientTlsPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateClientTlsPolicy. */ + public UnaryCallSettings + updateClientTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).updateClientTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to updateClientTlsPolicy. */ + public OperationCallSettings + updateClientTlsPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .updateClientTlsPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteClientTlsPolicy. */ + public UnaryCallSettings + deleteClientTlsPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).deleteClientTlsPolicySettings(); + } + + /** Returns the object with the settings used for calls to deleteClientTlsPolicy. */ + public OperationCallSettings + deleteClientTlsPolicyOperationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()) + .deleteClientTlsPolicyOperationSettings(); + } + + public static final NetworkSecuritySettings create(NetworkSecurityStubSettings stub) + throws IOException { + return new NetworkSecuritySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return NetworkSecurityStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return NetworkSecurityStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return NetworkSecurityStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return NetworkSecurityStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return NetworkSecurityStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return NetworkSecurityStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NetworkSecurityStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NetworkSecuritySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for NetworkSecuritySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(NetworkSecurityStubSettings.newBuilder(clientContext)); + } + + protected Builder(NetworkSecuritySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(NetworkSecurityStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(NetworkSecurityStubSettings.newBuilder()); + } + + public NetworkSecurityStubSettings.Builder getStubSettingsBuilder() { + return ((NetworkSecurityStubSettings.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 listAuthorizationPolicies. */ + public PagedCallSettings.Builder< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesSettings() { + return getStubSettingsBuilder().listAuthorizationPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to getAuthorizationPolicy. */ + public UnaryCallSettings.Builder + getAuthorizationPolicySettings() { + return getStubSettingsBuilder().getAuthorizationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createAuthorizationPolicy. */ + public UnaryCallSettings.Builder + createAuthorizationPolicySettings() { + return getStubSettingsBuilder().createAuthorizationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createAuthorizationPolicy. */ + public OperationCallSettings.Builder< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationSettings() { + return getStubSettingsBuilder().createAuthorizationPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateAuthorizationPolicy. */ + public UnaryCallSettings.Builder + updateAuthorizationPolicySettings() { + return getStubSettingsBuilder().updateAuthorizationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to updateAuthorizationPolicy. */ + public OperationCallSettings.Builder< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationSettings() { + return getStubSettingsBuilder().updateAuthorizationPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAuthorizationPolicy. */ + public UnaryCallSettings.Builder + deleteAuthorizationPolicySettings() { + return getStubSettingsBuilder().deleteAuthorizationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to deleteAuthorizationPolicy. */ + public OperationCallSettings.Builder + deleteAuthorizationPolicyOperationSettings() { + return getStubSettingsBuilder().deleteAuthorizationPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listServerTlsPolicies. */ + public PagedCallSettings.Builder< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + listServerTlsPoliciesSettings() { + return getStubSettingsBuilder().listServerTlsPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to getServerTlsPolicy. */ + public UnaryCallSettings.Builder + getServerTlsPolicySettings() { + return getStubSettingsBuilder().getServerTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createServerTlsPolicy. */ + public UnaryCallSettings.Builder + createServerTlsPolicySettings() { + return getStubSettingsBuilder().createServerTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createServerTlsPolicy. */ + public OperationCallSettings.Builder< + CreateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + createServerTlsPolicyOperationSettings() { + return getStubSettingsBuilder().createServerTlsPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateServerTlsPolicy. */ + public UnaryCallSettings.Builder + updateServerTlsPolicySettings() { + return getStubSettingsBuilder().updateServerTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to updateServerTlsPolicy. */ + public OperationCallSettings.Builder< + UpdateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + updateServerTlsPolicyOperationSettings() { + return getStubSettingsBuilder().updateServerTlsPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteServerTlsPolicy. */ + public UnaryCallSettings.Builder + deleteServerTlsPolicySettings() { + return getStubSettingsBuilder().deleteServerTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to deleteServerTlsPolicy. */ + public OperationCallSettings.Builder + deleteServerTlsPolicyOperationSettings() { + return getStubSettingsBuilder().deleteServerTlsPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listClientTlsPolicies. */ + public PagedCallSettings.Builder< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + listClientTlsPoliciesSettings() { + return getStubSettingsBuilder().listClientTlsPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to getClientTlsPolicy. */ + public UnaryCallSettings.Builder + getClientTlsPolicySettings() { + return getStubSettingsBuilder().getClientTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createClientTlsPolicy. */ + public UnaryCallSettings.Builder + createClientTlsPolicySettings() { + return getStubSettingsBuilder().createClientTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createClientTlsPolicy. */ + public OperationCallSettings.Builder< + CreateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + createClientTlsPolicyOperationSettings() { + return getStubSettingsBuilder().createClientTlsPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateClientTlsPolicy. */ + public UnaryCallSettings.Builder + updateClientTlsPolicySettings() { + return getStubSettingsBuilder().updateClientTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to updateClientTlsPolicy. */ + public OperationCallSettings.Builder< + UpdateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + updateClientTlsPolicyOperationSettings() { + return getStubSettingsBuilder().updateClientTlsPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteClientTlsPolicy. */ + public UnaryCallSettings.Builder + deleteClientTlsPolicySettings() { + return getStubSettingsBuilder().deleteClientTlsPolicySettings(); + } + + /** Returns the builder for the settings used for calls to deleteClientTlsPolicy. */ + public OperationCallSettings.Builder + deleteClientTlsPolicyOperationSettings() { + return getStubSettingsBuilder().deleteClientTlsPolicyOperationSettings(); + } + + @Override + public NetworkSecuritySettings build() throws IOException { + return new NetworkSecuritySettings(this); + } + } +} diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/gapic_metadata.json b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/gapic_metadata.json new file mode 100644 index 00000000..f7960392 --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.networksecurity.v1", + "libraryPackage": "com.google.cloud.networksecurity.v1", + "services": { + "NetworkSecurity": { + "clients": { + "grpc": { + "libraryClient": "NetworkSecurityClient", + "rpcs": { + "CreateAuthorizationPolicy": { + "methods": ["createAuthorizationPolicyAsync", "createAuthorizationPolicyAsync", "createAuthorizationPolicyAsync", "createAuthorizationPolicyOperationCallable", "createAuthorizationPolicyCallable"] + }, + "CreateClientTlsPolicy": { + "methods": ["createClientTlsPolicyAsync", "createClientTlsPolicyAsync", "createClientTlsPolicyAsync", "createClientTlsPolicyOperationCallable", "createClientTlsPolicyCallable"] + }, + "CreateServerTlsPolicy": { + "methods": ["createServerTlsPolicyAsync", "createServerTlsPolicyAsync", "createServerTlsPolicyAsync", "createServerTlsPolicyOperationCallable", "createServerTlsPolicyCallable"] + }, + "DeleteAuthorizationPolicy": { + "methods": ["deleteAuthorizationPolicyAsync", "deleteAuthorizationPolicyAsync", "deleteAuthorizationPolicyAsync", "deleteAuthorizationPolicyOperationCallable", "deleteAuthorizationPolicyCallable"] + }, + "DeleteClientTlsPolicy": { + "methods": ["deleteClientTlsPolicyAsync", "deleteClientTlsPolicyAsync", "deleteClientTlsPolicyAsync", "deleteClientTlsPolicyOperationCallable", "deleteClientTlsPolicyCallable"] + }, + "DeleteServerTlsPolicy": { + "methods": ["deleteServerTlsPolicyAsync", "deleteServerTlsPolicyAsync", "deleteServerTlsPolicyAsync", "deleteServerTlsPolicyOperationCallable", "deleteServerTlsPolicyCallable"] + }, + "GetAuthorizationPolicy": { + "methods": ["getAuthorizationPolicy", "getAuthorizationPolicy", "getAuthorizationPolicy", "getAuthorizationPolicyCallable"] + }, + "GetClientTlsPolicy": { + "methods": ["getClientTlsPolicy", "getClientTlsPolicy", "getClientTlsPolicy", "getClientTlsPolicyCallable"] + }, + "GetServerTlsPolicy": { + "methods": ["getServerTlsPolicy", "getServerTlsPolicy", "getServerTlsPolicy", "getServerTlsPolicyCallable"] + }, + "ListAuthorizationPolicies": { + "methods": ["listAuthorizationPolicies", "listAuthorizationPolicies", "listAuthorizationPolicies", "listAuthorizationPoliciesPagedCallable", "listAuthorizationPoliciesCallable"] + }, + "ListClientTlsPolicies": { + "methods": ["listClientTlsPolicies", "listClientTlsPolicies", "listClientTlsPolicies", "listClientTlsPoliciesPagedCallable", "listClientTlsPoliciesCallable"] + }, + "ListServerTlsPolicies": { + "methods": ["listServerTlsPolicies", "listServerTlsPolicies", "listServerTlsPolicies", "listServerTlsPoliciesPagedCallable", "listServerTlsPoliciesCallable"] + }, + "UpdateAuthorizationPolicy": { + "methods": ["updateAuthorizationPolicyAsync", "updateAuthorizationPolicyAsync", "updateAuthorizationPolicyOperationCallable", "updateAuthorizationPolicyCallable"] + }, + "UpdateClientTlsPolicy": { + "methods": ["updateClientTlsPolicyAsync", "updateClientTlsPolicyAsync", "updateClientTlsPolicyOperationCallable", "updateClientTlsPolicyCallable"] + }, + "UpdateServerTlsPolicy": { + "methods": ["updateServerTlsPolicyAsync", "updateServerTlsPolicyAsync", "updateServerTlsPolicyOperationCallable", "updateServerTlsPolicyCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/package-info.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/package-info.java new file mode 100644 index 00000000..3afe2545 --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/package-info.java @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= NetworkSecurityClient ======================= + * + *

Service Description: Network Security API provides resources to configure authentication and + * authorization policies. Refer to per API resource documentation for more information. + * + *

Sample for NetworkSecurityClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+ *   AuthorizationPolicyName name =
+ *       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
+ *   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.networksecurity.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityCallableFactory.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityCallableFactory.java new file mode 100644 index 00000000..1b22552f --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityCallableFactory.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.cloud.networksecurity.v1.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 NetworkSecurity service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcNetworkSecurityCallableFactory 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-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityStub.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityStub.java new file mode 100644 index 00000000..87af37d4 --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/GrpcNetworkSecurityStub.java @@ -0,0 +1,860 @@ +/* + * 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.cloud.networksecurity.v1.stub; + +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +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.cloud.networksecurity.v1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse; +import com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1.OperationMetadata; +import com.google.cloud.networksecurity.v1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +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 NetworkSecurity service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcNetworkSecurityStub extends NetworkSecurityStub { + private static final MethodDescriptor< + ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesResponse> + listAuthorizationPoliciesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/ListAuthorizationPolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAuthorizationPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAuthorizationPoliciesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAuthorizationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/GetAuthorizationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAuthorizationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AuthorizationPolicy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAuthorizationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/CreateAuthorizationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAuthorizationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateAuthorizationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/UpdateAuthorizationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAuthorizationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteAuthorizationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/DeleteAuthorizationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAuthorizationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listServerTlsPoliciesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/ListServerTlsPolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListServerTlsPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListServerTlsPoliciesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getServerTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/GetServerTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(GetServerTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ServerTlsPolicy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createServerTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/CreateServerTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateServerTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateServerTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/UpdateServerTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateServerTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteServerTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/DeleteServerTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteServerTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listClientTlsPoliciesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/ListClientTlsPolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListClientTlsPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListClientTlsPoliciesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getClientTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/GetClientTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(GetClientTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ClientTlsPolicy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClientTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/CreateClientTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClientTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateClientTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/UpdateClientTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateClientTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteClientTlsPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.networksecurity.v1.NetworkSecurity/DeleteClientTlsPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClientTlsPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable + listAuthorizationPoliciesCallable; + private final UnaryCallable< + ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesPagedCallable; + private final UnaryCallable + getAuthorizationPolicyCallable; + private final UnaryCallable + createAuthorizationPolicyCallable; + private final OperationCallable< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationCallable; + private final UnaryCallable + updateAuthorizationPolicyCallable; + private final OperationCallable< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationCallable; + private final UnaryCallable + deleteAuthorizationPolicyCallable; + private final OperationCallable + deleteAuthorizationPolicyOperationCallable; + private final UnaryCallable + listServerTlsPoliciesCallable; + private final UnaryCallable + listServerTlsPoliciesPagedCallable; + private final UnaryCallable + getServerTlsPolicyCallable; + private final UnaryCallable + createServerTlsPolicyCallable; + private final OperationCallable + createServerTlsPolicyOperationCallable; + private final UnaryCallable + updateServerTlsPolicyCallable; + private final OperationCallable + updateServerTlsPolicyOperationCallable; + private final UnaryCallable + deleteServerTlsPolicyCallable; + private final OperationCallable + deleteServerTlsPolicyOperationCallable; + private final UnaryCallable + listClientTlsPoliciesCallable; + private final UnaryCallable + listClientTlsPoliciesPagedCallable; + private final UnaryCallable + getClientTlsPolicyCallable; + private final UnaryCallable + createClientTlsPolicyCallable; + private final OperationCallable + createClientTlsPolicyOperationCallable; + private final UnaryCallable + updateClientTlsPolicyCallable; + private final OperationCallable + updateClientTlsPolicyOperationCallable; + private final UnaryCallable + deleteClientTlsPolicyCallable; + private final OperationCallable + deleteClientTlsPolicyOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcNetworkSecurityStub create(NetworkSecurityStubSettings settings) + throws IOException { + return new GrpcNetworkSecurityStub(settings, ClientContext.create(settings)); + } + + public static final GrpcNetworkSecurityStub create(ClientContext clientContext) + throws IOException { + return new GrpcNetworkSecurityStub( + NetworkSecurityStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcNetworkSecurityStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcNetworkSecurityStub( + NetworkSecurityStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcNetworkSecurityStub, 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 GrpcNetworkSecurityStub( + NetworkSecurityStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcNetworkSecurityCallableFactory()); + } + + /** + * Constructs an instance of GrpcNetworkSecurityStub, 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 GrpcNetworkSecurityStub( + NetworkSecurityStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listAuthorizationPoliciesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listAuthorizationPoliciesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + getAuthorizationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAuthorizationPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + createAuthorizationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAuthorizationPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateAuthorizationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAuthorizationPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "authorization_policy.name", + String.valueOf(request.getAuthorizationPolicy().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteAuthorizationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAuthorizationPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listServerTlsPoliciesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listServerTlsPoliciesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + getServerTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getServerTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + createServerTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createServerTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateServerTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateServerTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "server_tls_policy.name", + String.valueOf(request.getServerTlsPolicy().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteServerTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteServerTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listClientTlsPoliciesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listClientTlsPoliciesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + getClientTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClientTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + createClientTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClientTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + updateClientTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClientTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "client_tls_policy.name", + String.valueOf(request.getClientTlsPolicy().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + deleteClientTlsPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClientTlsPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listAuthorizationPoliciesCallable = + callableFactory.createUnaryCallable( + listAuthorizationPoliciesTransportSettings, + settings.listAuthorizationPoliciesSettings(), + clientContext); + this.listAuthorizationPoliciesPagedCallable = + callableFactory.createPagedCallable( + listAuthorizationPoliciesTransportSettings, + settings.listAuthorizationPoliciesSettings(), + clientContext); + this.getAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + getAuthorizationPolicyTransportSettings, + settings.getAuthorizationPolicySettings(), + clientContext); + this.createAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + createAuthorizationPolicyTransportSettings, + settings.createAuthorizationPolicySettings(), + clientContext); + this.createAuthorizationPolicyOperationCallable = + callableFactory.createOperationCallable( + createAuthorizationPolicyTransportSettings, + settings.createAuthorizationPolicyOperationSettings(), + clientContext, + operationsStub); + this.updateAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + updateAuthorizationPolicyTransportSettings, + settings.updateAuthorizationPolicySettings(), + clientContext); + this.updateAuthorizationPolicyOperationCallable = + callableFactory.createOperationCallable( + updateAuthorizationPolicyTransportSettings, + settings.updateAuthorizationPolicyOperationSettings(), + clientContext, + operationsStub); + this.deleteAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + deleteAuthorizationPolicyTransportSettings, + settings.deleteAuthorizationPolicySettings(), + clientContext); + this.deleteAuthorizationPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteAuthorizationPolicyTransportSettings, + settings.deleteAuthorizationPolicyOperationSettings(), + clientContext, + operationsStub); + this.listServerTlsPoliciesCallable = + callableFactory.createUnaryCallable( + listServerTlsPoliciesTransportSettings, + settings.listServerTlsPoliciesSettings(), + clientContext); + this.listServerTlsPoliciesPagedCallable = + callableFactory.createPagedCallable( + listServerTlsPoliciesTransportSettings, + settings.listServerTlsPoliciesSettings(), + clientContext); + this.getServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + getServerTlsPolicyTransportSettings, + settings.getServerTlsPolicySettings(), + clientContext); + this.createServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + createServerTlsPolicyTransportSettings, + settings.createServerTlsPolicySettings(), + clientContext); + this.createServerTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + createServerTlsPolicyTransportSettings, + settings.createServerTlsPolicyOperationSettings(), + clientContext, + operationsStub); + this.updateServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + updateServerTlsPolicyTransportSettings, + settings.updateServerTlsPolicySettings(), + clientContext); + this.updateServerTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + updateServerTlsPolicyTransportSettings, + settings.updateServerTlsPolicyOperationSettings(), + clientContext, + operationsStub); + this.deleteServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + deleteServerTlsPolicyTransportSettings, + settings.deleteServerTlsPolicySettings(), + clientContext); + this.deleteServerTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteServerTlsPolicyTransportSettings, + settings.deleteServerTlsPolicyOperationSettings(), + clientContext, + operationsStub); + this.listClientTlsPoliciesCallable = + callableFactory.createUnaryCallable( + listClientTlsPoliciesTransportSettings, + settings.listClientTlsPoliciesSettings(), + clientContext); + this.listClientTlsPoliciesPagedCallable = + callableFactory.createPagedCallable( + listClientTlsPoliciesTransportSettings, + settings.listClientTlsPoliciesSettings(), + clientContext); + this.getClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + getClientTlsPolicyTransportSettings, + settings.getClientTlsPolicySettings(), + clientContext); + this.createClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + createClientTlsPolicyTransportSettings, + settings.createClientTlsPolicySettings(), + clientContext); + this.createClientTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + createClientTlsPolicyTransportSettings, + settings.createClientTlsPolicyOperationSettings(), + clientContext, + operationsStub); + this.updateClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + updateClientTlsPolicyTransportSettings, + settings.updateClientTlsPolicySettings(), + clientContext); + this.updateClientTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + updateClientTlsPolicyTransportSettings, + settings.updateClientTlsPolicyOperationSettings(), + clientContext, + operationsStub); + this.deleteClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + deleteClientTlsPolicyTransportSettings, + settings.deleteClientTlsPolicySettings(), + clientContext); + this.deleteClientTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteClientTlsPolicyTransportSettings, + settings.deleteClientTlsPolicyOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listAuthorizationPoliciesCallable() { + return listAuthorizationPoliciesCallable; + } + + @Override + public UnaryCallable + listAuthorizationPoliciesPagedCallable() { + return listAuthorizationPoliciesPagedCallable; + } + + @Override + public UnaryCallable + getAuthorizationPolicyCallable() { + return getAuthorizationPolicyCallable; + } + + @Override + public UnaryCallable + createAuthorizationPolicyCallable() { + return createAuthorizationPolicyCallable; + } + + @Override + public OperationCallable + createAuthorizationPolicyOperationCallable() { + return createAuthorizationPolicyOperationCallable; + } + + @Override + public UnaryCallable + updateAuthorizationPolicyCallable() { + return updateAuthorizationPolicyCallable; + } + + @Override + public OperationCallable + updateAuthorizationPolicyOperationCallable() { + return updateAuthorizationPolicyOperationCallable; + } + + @Override + public UnaryCallable + deleteAuthorizationPolicyCallable() { + return deleteAuthorizationPolicyCallable; + } + + @Override + public OperationCallable + deleteAuthorizationPolicyOperationCallable() { + return deleteAuthorizationPolicyOperationCallable; + } + + @Override + public UnaryCallable + listServerTlsPoliciesCallable() { + return listServerTlsPoliciesCallable; + } + + @Override + public UnaryCallable + listServerTlsPoliciesPagedCallable() { + return listServerTlsPoliciesPagedCallable; + } + + @Override + public UnaryCallable getServerTlsPolicyCallable() { + return getServerTlsPolicyCallable; + } + + @Override + public UnaryCallable createServerTlsPolicyCallable() { + return createServerTlsPolicyCallable; + } + + @Override + public OperationCallable + createServerTlsPolicyOperationCallable() { + return createServerTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable updateServerTlsPolicyCallable() { + return updateServerTlsPolicyCallable; + } + + @Override + public OperationCallable + updateServerTlsPolicyOperationCallable() { + return updateServerTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable deleteServerTlsPolicyCallable() { + return deleteServerTlsPolicyCallable; + } + + @Override + public OperationCallable + deleteServerTlsPolicyOperationCallable() { + return deleteServerTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable + listClientTlsPoliciesCallable() { + return listClientTlsPoliciesCallable; + } + + @Override + public UnaryCallable + listClientTlsPoliciesPagedCallable() { + return listClientTlsPoliciesPagedCallable; + } + + @Override + public UnaryCallable getClientTlsPolicyCallable() { + return getClientTlsPolicyCallable; + } + + @Override + public UnaryCallable createClientTlsPolicyCallable() { + return createClientTlsPolicyCallable; + } + + @Override + public OperationCallable + createClientTlsPolicyOperationCallable() { + return createClientTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable updateClientTlsPolicyCallable() { + return updateClientTlsPolicyCallable; + } + + @Override + public OperationCallable + updateClientTlsPolicyOperationCallable() { + return updateClientTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable deleteClientTlsPolicyCallable() { + return deleteClientTlsPolicyCallable; + } + + @Override + public OperationCallable + deleteClientTlsPolicyOperationCallable() { + return deleteClientTlsPolicyOperationCallable; + } + + @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-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStub.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStub.java new file mode 100644 index 00000000..89a20016 --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStub.java @@ -0,0 +1,207 @@ +/* + * 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.cloud.networksecurity.v1.stub; + +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.networksecurity.v1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse; +import com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1.OperationMetadata; +import com.google.cloud.networksecurity.v1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the NetworkSecurity service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class NetworkSecurityStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listAuthorizationPoliciesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAuthorizationPoliciesPagedCallable()"); + } + + public UnaryCallable + listAuthorizationPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listAuthorizationPoliciesCallable()"); + } + + public UnaryCallable + getAuthorizationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getAuthorizationPolicyCallable()"); + } + + public OperationCallable + createAuthorizationPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createAuthorizationPolicyOperationCallable()"); + } + + public UnaryCallable + createAuthorizationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: createAuthorizationPolicyCallable()"); + } + + public OperationCallable + updateAuthorizationPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateAuthorizationPolicyOperationCallable()"); + } + + public UnaryCallable + updateAuthorizationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updateAuthorizationPolicyCallable()"); + } + + public OperationCallable + deleteAuthorizationPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteAuthorizationPolicyOperationCallable()"); + } + + public UnaryCallable + deleteAuthorizationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAuthorizationPolicyCallable()"); + } + + public UnaryCallable + listServerTlsPoliciesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listServerTlsPoliciesPagedCallable()"); + } + + public UnaryCallable + listServerTlsPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listServerTlsPoliciesCallable()"); + } + + public UnaryCallable getServerTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getServerTlsPolicyCallable()"); + } + + public OperationCallable + createServerTlsPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createServerTlsPolicyOperationCallable()"); + } + + public UnaryCallable createServerTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: createServerTlsPolicyCallable()"); + } + + public OperationCallable + updateServerTlsPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateServerTlsPolicyOperationCallable()"); + } + + public UnaryCallable updateServerTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updateServerTlsPolicyCallable()"); + } + + public OperationCallable + deleteServerTlsPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteServerTlsPolicyOperationCallable()"); + } + + public UnaryCallable deleteServerTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteServerTlsPolicyCallable()"); + } + + public UnaryCallable + listClientTlsPoliciesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listClientTlsPoliciesPagedCallable()"); + } + + public UnaryCallable + listClientTlsPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listClientTlsPoliciesCallable()"); + } + + public UnaryCallable getClientTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getClientTlsPolicyCallable()"); + } + + public OperationCallable + createClientTlsPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createClientTlsPolicyOperationCallable()"); + } + + public UnaryCallable createClientTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: createClientTlsPolicyCallable()"); + } + + public OperationCallable + updateClientTlsPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateClientTlsPolicyOperationCallable()"); + } + + public UnaryCallable updateClientTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updateClientTlsPolicyCallable()"); + } + + public OperationCallable + deleteClientTlsPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteClientTlsPolicyOperationCallable()"); + } + + public UnaryCallable deleteClientTlsPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteClientTlsPolicyCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStubSettings.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStubSettings.java new file mode 100644 index 00000000..d9c8897c --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1/stub/NetworkSecurityStubSettings.java @@ -0,0 +1,1372 @@ +/* + * 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.cloud.networksecurity.v1.stub; + +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +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.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.cloud.networksecurity.v1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse; +import com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1.OperationMetadata; +import com.google.cloud.networksecurity.v1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; +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.longrunning.Operation; +import com.google.protobuf.Empty; +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 NetworkSecurityStub}. + * + *

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

    + *
  • The default service address (networksecurity.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 getAuthorizationPolicy to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * NetworkSecurityStubSettings.Builder networkSecuritySettingsBuilder =
+ *     NetworkSecurityStubSettings.newBuilder();
+ * networkSecuritySettingsBuilder
+ *     .getAuthorizationPolicySettings()
+ *     .setRetrySettings(
+ *         networkSecuritySettingsBuilder
+ *             .getAuthorizationPolicySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * NetworkSecurityStubSettings networkSecuritySettings = networkSecuritySettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class NetworkSecurityStubSettings 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< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesSettings; + private final UnaryCallSettings + getAuthorizationPolicySettings; + private final UnaryCallSettings + createAuthorizationPolicySettings; + private final OperationCallSettings< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationSettings; + private final UnaryCallSettings + updateAuthorizationPolicySettings; + private final OperationCallSettings< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationSettings; + private final UnaryCallSettings + deleteAuthorizationPolicySettings; + private final OperationCallSettings + deleteAuthorizationPolicyOperationSettings; + private final PagedCallSettings< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + listServerTlsPoliciesSettings; + private final UnaryCallSettings + getServerTlsPolicySettings; + private final UnaryCallSettings + createServerTlsPolicySettings; + private final OperationCallSettings< + CreateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + createServerTlsPolicyOperationSettings; + private final UnaryCallSettings + updateServerTlsPolicySettings; + private final OperationCallSettings< + UpdateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + updateServerTlsPolicyOperationSettings; + private final UnaryCallSettings + deleteServerTlsPolicySettings; + private final OperationCallSettings + deleteServerTlsPolicyOperationSettings; + private final PagedCallSettings< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + listClientTlsPoliciesSettings; + private final UnaryCallSettings + getClientTlsPolicySettings; + private final UnaryCallSettings + createClientTlsPolicySettings; + private final OperationCallSettings< + CreateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + createClientTlsPolicyOperationSettings; + private final UnaryCallSettings + updateClientTlsPolicySettings; + private final OperationCallSettings< + UpdateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + updateClientTlsPolicyOperationSettings; + private final UnaryCallSettings + deleteClientTlsPolicySettings; + private final OperationCallSettings + deleteClientTlsPolicyOperationSettings; + + private static final PagedListDescriptor< + ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesResponse, AuthorizationPolicy> + LIST_AUTHORIZATION_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAuthorizationPoliciesRequest injectToken( + ListAuthorizationPoliciesRequest payload, String token) { + return ListAuthorizationPoliciesRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListAuthorizationPoliciesRequest injectPageSize( + ListAuthorizationPoliciesRequest payload, int pageSize) { + return ListAuthorizationPoliciesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListAuthorizationPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAuthorizationPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAuthorizationPoliciesResponse payload) { + return payload.getAuthorizationPoliciesList() == null + ? ImmutableList.of() + : payload.getAuthorizationPoliciesList(); + } + }; + + private static final PagedListDescriptor< + ListServerTlsPoliciesRequest, ListServerTlsPoliciesResponse, ServerTlsPolicy> + LIST_SERVER_TLS_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListServerTlsPoliciesRequest, ListServerTlsPoliciesResponse, ServerTlsPolicy>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListServerTlsPoliciesRequest injectToken( + ListServerTlsPoliciesRequest payload, String token) { + return ListServerTlsPoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListServerTlsPoliciesRequest injectPageSize( + ListServerTlsPoliciesRequest payload, int pageSize) { + return ListServerTlsPoliciesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListServerTlsPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListServerTlsPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListServerTlsPoliciesResponse payload) { + return payload.getServerTlsPoliciesList() == null + ? ImmutableList.of() + : payload.getServerTlsPoliciesList(); + } + }; + + private static final PagedListDescriptor< + ListClientTlsPoliciesRequest, ListClientTlsPoliciesResponse, ClientTlsPolicy> + LIST_CLIENT_TLS_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListClientTlsPoliciesRequest, ListClientTlsPoliciesResponse, ClientTlsPolicy>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListClientTlsPoliciesRequest injectToken( + ListClientTlsPoliciesRequest payload, String token) { + return ListClientTlsPoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListClientTlsPoliciesRequest injectPageSize( + ListClientTlsPoliciesRequest payload, int pageSize) { + return ListClientTlsPoliciesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListClientTlsPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListClientTlsPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListClientTlsPoliciesResponse payload) { + return payload.getClientTlsPoliciesList() == null + ? ImmutableList.of() + : payload.getClientTlsPoliciesList(); + } + }; + + private static final PagedListResponseFactory< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + LIST_AUTHORIZATION_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListAuthorizationPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + AuthorizationPolicy> + pageContext = + PageContext.create( + callable, LIST_AUTHORIZATION_POLICIES_PAGE_STR_DESC, request, context); + return ListAuthorizationPoliciesPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + LIST_SERVER_TLS_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListServerTlsPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListServerTlsPoliciesRequest, ListServerTlsPoliciesResponse, ServerTlsPolicy> + pageContext = + PageContext.create( + callable, LIST_SERVER_TLS_POLICIES_PAGE_STR_DESC, request, context); + return ListServerTlsPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + LIST_CLIENT_TLS_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListClientTlsPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListClientTlsPoliciesRequest, ListClientTlsPoliciesResponse, ClientTlsPolicy> + pageContext = + PageContext.create( + callable, LIST_CLIENT_TLS_POLICIES_PAGE_STR_DESC, request, context); + return ListClientTlsPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listAuthorizationPolicies. */ + public PagedCallSettings< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesSettings() { + return listAuthorizationPoliciesSettings; + } + + /** Returns the object with the settings used for calls to getAuthorizationPolicy. */ + public UnaryCallSettings + getAuthorizationPolicySettings() { + return getAuthorizationPolicySettings; + } + + /** Returns the object with the settings used for calls to createAuthorizationPolicy. */ + public UnaryCallSettings + createAuthorizationPolicySettings() { + return createAuthorizationPolicySettings; + } + + /** Returns the object with the settings used for calls to createAuthorizationPolicy. */ + public OperationCallSettings< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationSettings() { + return createAuthorizationPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to updateAuthorizationPolicy. */ + public UnaryCallSettings + updateAuthorizationPolicySettings() { + return updateAuthorizationPolicySettings; + } + + /** Returns the object with the settings used for calls to updateAuthorizationPolicy. */ + public OperationCallSettings< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationSettings() { + return updateAuthorizationPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteAuthorizationPolicy. */ + public UnaryCallSettings + deleteAuthorizationPolicySettings() { + return deleteAuthorizationPolicySettings; + } + + /** Returns the object with the settings used for calls to deleteAuthorizationPolicy. */ + public OperationCallSettings + deleteAuthorizationPolicyOperationSettings() { + return deleteAuthorizationPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to listServerTlsPolicies. */ + public PagedCallSettings< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + listServerTlsPoliciesSettings() { + return listServerTlsPoliciesSettings; + } + + /** Returns the object with the settings used for calls to getServerTlsPolicy. */ + public UnaryCallSettings + getServerTlsPolicySettings() { + return getServerTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to createServerTlsPolicy. */ + public UnaryCallSettings + createServerTlsPolicySettings() { + return createServerTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to createServerTlsPolicy. */ + public OperationCallSettings + createServerTlsPolicyOperationSettings() { + return createServerTlsPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to updateServerTlsPolicy. */ + public UnaryCallSettings + updateServerTlsPolicySettings() { + return updateServerTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to updateServerTlsPolicy. */ + public OperationCallSettings + updateServerTlsPolicyOperationSettings() { + return updateServerTlsPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteServerTlsPolicy. */ + public UnaryCallSettings + deleteServerTlsPolicySettings() { + return deleteServerTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to deleteServerTlsPolicy. */ + public OperationCallSettings + deleteServerTlsPolicyOperationSettings() { + return deleteServerTlsPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to listClientTlsPolicies. */ + public PagedCallSettings< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + listClientTlsPoliciesSettings() { + return listClientTlsPoliciesSettings; + } + + /** Returns the object with the settings used for calls to getClientTlsPolicy. */ + public UnaryCallSettings + getClientTlsPolicySettings() { + return getClientTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to createClientTlsPolicy. */ + public UnaryCallSettings + createClientTlsPolicySettings() { + return createClientTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to createClientTlsPolicy. */ + public OperationCallSettings + createClientTlsPolicyOperationSettings() { + return createClientTlsPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to updateClientTlsPolicy. */ + public UnaryCallSettings + updateClientTlsPolicySettings() { + return updateClientTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to updateClientTlsPolicy. */ + public OperationCallSettings + updateClientTlsPolicyOperationSettings() { + return updateClientTlsPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteClientTlsPolicy. */ + public UnaryCallSettings + deleteClientTlsPolicySettings() { + return deleteClientTlsPolicySettings; + } + + /** Returns the object with the settings used for calls to deleteClientTlsPolicy. */ + public OperationCallSettings + deleteClientTlsPolicyOperationSettings() { + return deleteClientTlsPolicyOperationSettings; + } + + public NetworkSecurityStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcNetworkSecurityStub.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 "networksecurity.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "networksecurity.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(NetworkSecurityStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NetworkSecurityStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listAuthorizationPoliciesSettings = settingsBuilder.listAuthorizationPoliciesSettings().build(); + getAuthorizationPolicySettings = settingsBuilder.getAuthorizationPolicySettings().build(); + createAuthorizationPolicySettings = settingsBuilder.createAuthorizationPolicySettings().build(); + createAuthorizationPolicyOperationSettings = + settingsBuilder.createAuthorizationPolicyOperationSettings().build(); + updateAuthorizationPolicySettings = settingsBuilder.updateAuthorizationPolicySettings().build(); + updateAuthorizationPolicyOperationSettings = + settingsBuilder.updateAuthorizationPolicyOperationSettings().build(); + deleteAuthorizationPolicySettings = settingsBuilder.deleteAuthorizationPolicySettings().build(); + deleteAuthorizationPolicyOperationSettings = + settingsBuilder.deleteAuthorizationPolicyOperationSettings().build(); + listServerTlsPoliciesSettings = settingsBuilder.listServerTlsPoliciesSettings().build(); + getServerTlsPolicySettings = settingsBuilder.getServerTlsPolicySettings().build(); + createServerTlsPolicySettings = settingsBuilder.createServerTlsPolicySettings().build(); + createServerTlsPolicyOperationSettings = + settingsBuilder.createServerTlsPolicyOperationSettings().build(); + updateServerTlsPolicySettings = settingsBuilder.updateServerTlsPolicySettings().build(); + updateServerTlsPolicyOperationSettings = + settingsBuilder.updateServerTlsPolicyOperationSettings().build(); + deleteServerTlsPolicySettings = settingsBuilder.deleteServerTlsPolicySettings().build(); + deleteServerTlsPolicyOperationSettings = + settingsBuilder.deleteServerTlsPolicyOperationSettings().build(); + listClientTlsPoliciesSettings = settingsBuilder.listClientTlsPoliciesSettings().build(); + getClientTlsPolicySettings = settingsBuilder.getClientTlsPolicySettings().build(); + createClientTlsPolicySettings = settingsBuilder.createClientTlsPolicySettings().build(); + createClientTlsPolicyOperationSettings = + settingsBuilder.createClientTlsPolicyOperationSettings().build(); + updateClientTlsPolicySettings = settingsBuilder.updateClientTlsPolicySettings().build(); + updateClientTlsPolicyOperationSettings = + settingsBuilder.updateClientTlsPolicyOperationSettings().build(); + deleteClientTlsPolicySettings = settingsBuilder.deleteClientTlsPolicySettings().build(); + deleteClientTlsPolicyOperationSettings = + settingsBuilder.deleteClientTlsPolicyOperationSettings().build(); + } + + /** Builder for NetworkSecurityStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesSettings; + private final UnaryCallSettings.Builder + getAuthorizationPolicySettings; + private final UnaryCallSettings.Builder + createAuthorizationPolicySettings; + private final OperationCallSettings.Builder< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationSettings; + private final UnaryCallSettings.Builder + updateAuthorizationPolicySettings; + private final OperationCallSettings.Builder< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationSettings; + private final UnaryCallSettings.Builder + deleteAuthorizationPolicySettings; + private final OperationCallSettings.Builder< + DeleteAuthorizationPolicyRequest, Empty, OperationMetadata> + deleteAuthorizationPolicyOperationSettings; + private final PagedCallSettings.Builder< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + listServerTlsPoliciesSettings; + private final UnaryCallSettings.Builder + getServerTlsPolicySettings; + private final UnaryCallSettings.Builder + createServerTlsPolicySettings; + private final OperationCallSettings.Builder< + CreateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + createServerTlsPolicyOperationSettings; + private final UnaryCallSettings.Builder + updateServerTlsPolicySettings; + private final OperationCallSettings.Builder< + UpdateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + updateServerTlsPolicyOperationSettings; + private final UnaryCallSettings.Builder + deleteServerTlsPolicySettings; + private final OperationCallSettings.Builder< + DeleteServerTlsPolicyRequest, Empty, OperationMetadata> + deleteServerTlsPolicyOperationSettings; + private final PagedCallSettings.Builder< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + listClientTlsPoliciesSettings; + private final UnaryCallSettings.Builder + getClientTlsPolicySettings; + private final UnaryCallSettings.Builder + createClientTlsPolicySettings; + private final OperationCallSettings.Builder< + CreateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + createClientTlsPolicyOperationSettings; + private final UnaryCallSettings.Builder + updateClientTlsPolicySettings; + private final OperationCallSettings.Builder< + UpdateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + updateClientTlsPolicyOperationSettings; + private final UnaryCallSettings.Builder + deleteClientTlsPolicySettings; + private final OperationCallSettings.Builder< + DeleteClientTlsPolicyRequest, Empty, OperationMetadata> + deleteClientTlsPolicyOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_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() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAuthorizationPoliciesSettings = + PagedCallSettings.newBuilder(LIST_AUTHORIZATION_POLICIES_PAGE_STR_FACT); + getAuthorizationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAuthorizationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAuthorizationPolicyOperationSettings = OperationCallSettings.newBuilder(); + updateAuthorizationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAuthorizationPolicyOperationSettings = OperationCallSettings.newBuilder(); + deleteAuthorizationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteAuthorizationPolicyOperationSettings = OperationCallSettings.newBuilder(); + listServerTlsPoliciesSettings = + PagedCallSettings.newBuilder(LIST_SERVER_TLS_POLICIES_PAGE_STR_FACT); + getServerTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createServerTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createServerTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + updateServerTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateServerTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + deleteServerTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteServerTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + listClientTlsPoliciesSettings = + PagedCallSettings.newBuilder(LIST_CLIENT_TLS_POLICIES_PAGE_STR_FACT); + getClientTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClientTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClientTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + updateClientTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClientTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + deleteClientTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClientTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAuthorizationPoliciesSettings, + getAuthorizationPolicySettings, + createAuthorizationPolicySettings, + updateAuthorizationPolicySettings, + deleteAuthorizationPolicySettings, + listServerTlsPoliciesSettings, + getServerTlsPolicySettings, + createServerTlsPolicySettings, + updateServerTlsPolicySettings, + deleteServerTlsPolicySettings, + listClientTlsPoliciesSettings, + getClientTlsPolicySettings, + createClientTlsPolicySettings, + updateClientTlsPolicySettings, + deleteClientTlsPolicySettings); + initDefaults(this); + } + + protected Builder(NetworkSecurityStubSettings settings) { + super(settings); + + listAuthorizationPoliciesSettings = settings.listAuthorizationPoliciesSettings.toBuilder(); + getAuthorizationPolicySettings = settings.getAuthorizationPolicySettings.toBuilder(); + createAuthorizationPolicySettings = settings.createAuthorizationPolicySettings.toBuilder(); + createAuthorizationPolicyOperationSettings = + settings.createAuthorizationPolicyOperationSettings.toBuilder(); + updateAuthorizationPolicySettings = settings.updateAuthorizationPolicySettings.toBuilder(); + updateAuthorizationPolicyOperationSettings = + settings.updateAuthorizationPolicyOperationSettings.toBuilder(); + deleteAuthorizationPolicySettings = settings.deleteAuthorizationPolicySettings.toBuilder(); + deleteAuthorizationPolicyOperationSettings = + settings.deleteAuthorizationPolicyOperationSettings.toBuilder(); + listServerTlsPoliciesSettings = settings.listServerTlsPoliciesSettings.toBuilder(); + getServerTlsPolicySettings = settings.getServerTlsPolicySettings.toBuilder(); + createServerTlsPolicySettings = settings.createServerTlsPolicySettings.toBuilder(); + createServerTlsPolicyOperationSettings = + settings.createServerTlsPolicyOperationSettings.toBuilder(); + updateServerTlsPolicySettings = settings.updateServerTlsPolicySettings.toBuilder(); + updateServerTlsPolicyOperationSettings = + settings.updateServerTlsPolicyOperationSettings.toBuilder(); + deleteServerTlsPolicySettings = settings.deleteServerTlsPolicySettings.toBuilder(); + deleteServerTlsPolicyOperationSettings = + settings.deleteServerTlsPolicyOperationSettings.toBuilder(); + listClientTlsPoliciesSettings = settings.listClientTlsPoliciesSettings.toBuilder(); + getClientTlsPolicySettings = settings.getClientTlsPolicySettings.toBuilder(); + createClientTlsPolicySettings = settings.createClientTlsPolicySettings.toBuilder(); + createClientTlsPolicyOperationSettings = + settings.createClientTlsPolicyOperationSettings.toBuilder(); + updateClientTlsPolicySettings = settings.updateClientTlsPolicySettings.toBuilder(); + updateClientTlsPolicyOperationSettings = + settings.updateClientTlsPolicyOperationSettings.toBuilder(); + deleteClientTlsPolicySettings = settings.deleteClientTlsPolicySettings.toBuilder(); + deleteClientTlsPolicyOperationSettings = + settings.deleteClientTlsPolicyOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAuthorizationPoliciesSettings, + getAuthorizationPolicySettings, + createAuthorizationPolicySettings, + updateAuthorizationPolicySettings, + deleteAuthorizationPolicySettings, + listServerTlsPoliciesSettings, + getServerTlsPolicySettings, + createServerTlsPolicySettings, + updateServerTlsPolicySettings, + deleteServerTlsPolicySettings, + listClientTlsPoliciesSettings, + getClientTlsPolicySettings, + createClientTlsPolicySettings, + updateClientTlsPolicySettings, + deleteClientTlsPolicySettings); + } + + 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 initDefaults(Builder builder) { + builder + .listAuthorizationPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getAuthorizationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createAuthorizationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateAuthorizationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteAuthorizationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listServerTlsPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getServerTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createServerTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateServerTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteServerTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listClientTlsPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getClientTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createClientTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateClientTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteClientTlsPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createAuthorizationPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AuthorizationPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .updateAuthorizationPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AuthorizationPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .deleteAuthorizationPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .createServerTlsPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ServerTlsPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .updateServerTlsPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ServerTlsPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .deleteServerTlsPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .createClientTlsPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ClientTlsPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .updateClientTlsPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ClientTlsPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 + .deleteClientTlsPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.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 listAuthorizationPolicies. */ + public PagedCallSettings.Builder< + ListAuthorizationPoliciesRequest, + ListAuthorizationPoliciesResponse, + ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesSettings() { + return listAuthorizationPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to getAuthorizationPolicy. */ + public UnaryCallSettings.Builder + getAuthorizationPolicySettings() { + return getAuthorizationPolicySettings; + } + + /** Returns the builder for the settings used for calls to createAuthorizationPolicy. */ + public UnaryCallSettings.Builder + createAuthorizationPolicySettings() { + return createAuthorizationPolicySettings; + } + + /** Returns the builder for the settings used for calls to createAuthorizationPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationSettings() { + return createAuthorizationPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateAuthorizationPolicy. */ + public UnaryCallSettings.Builder + updateAuthorizationPolicySettings() { + return updateAuthorizationPolicySettings; + } + + /** Returns the builder for the settings used for calls to updateAuthorizationPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationSettings() { + return updateAuthorizationPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteAuthorizationPolicy. */ + public UnaryCallSettings.Builder + deleteAuthorizationPolicySettings() { + return deleteAuthorizationPolicySettings; + } + + /** Returns the builder for the settings used for calls to deleteAuthorizationPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteAuthorizationPolicyOperationSettings() { + return deleteAuthorizationPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to listServerTlsPolicies. */ + public PagedCallSettings.Builder< + ListServerTlsPoliciesRequest, + ListServerTlsPoliciesResponse, + ListServerTlsPoliciesPagedResponse> + listServerTlsPoliciesSettings() { + return listServerTlsPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to getServerTlsPolicy. */ + public UnaryCallSettings.Builder + getServerTlsPolicySettings() { + return getServerTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to createServerTlsPolicy. */ + public UnaryCallSettings.Builder + createServerTlsPolicySettings() { + return createServerTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to createServerTlsPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + createServerTlsPolicyOperationSettings() { + return createServerTlsPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateServerTlsPolicy. */ + public UnaryCallSettings.Builder + updateServerTlsPolicySettings() { + return updateServerTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to updateServerTlsPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateServerTlsPolicyRequest, ServerTlsPolicy, OperationMetadata> + updateServerTlsPolicyOperationSettings() { + return updateServerTlsPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteServerTlsPolicy. */ + public UnaryCallSettings.Builder + deleteServerTlsPolicySettings() { + return deleteServerTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to deleteServerTlsPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteServerTlsPolicyOperationSettings() { + return deleteServerTlsPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to listClientTlsPolicies. */ + public PagedCallSettings.Builder< + ListClientTlsPoliciesRequest, + ListClientTlsPoliciesResponse, + ListClientTlsPoliciesPagedResponse> + listClientTlsPoliciesSettings() { + return listClientTlsPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to getClientTlsPolicy. */ + public UnaryCallSettings.Builder + getClientTlsPolicySettings() { + return getClientTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to createClientTlsPolicy. */ + public UnaryCallSettings.Builder + createClientTlsPolicySettings() { + return createClientTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to createClientTlsPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + createClientTlsPolicyOperationSettings() { + return createClientTlsPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateClientTlsPolicy. */ + public UnaryCallSettings.Builder + updateClientTlsPolicySettings() { + return updateClientTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to updateClientTlsPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateClientTlsPolicyRequest, ClientTlsPolicy, OperationMetadata> + updateClientTlsPolicyOperationSettings() { + return updateClientTlsPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteClientTlsPolicy. */ + public UnaryCallSettings.Builder + deleteClientTlsPolicySettings() { + return deleteClientTlsPolicySettings; + } + + /** Returns the builder for the settings used for calls to deleteClientTlsPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteClientTlsPolicyOperationSettings() { + return deleteClientTlsPolicyOperationSettings; + } + + @Override + public NetworkSecurityStubSettings build() throws IOException { + return new NetworkSecurityStubSettings(this); + } + } +} diff --git a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurity.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurity.java new file mode 100644 index 00000000..c26d247e --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurity.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.cloud.networksecurity.v1; + +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 MockNetworkSecurity implements MockGrpcService { + private final MockNetworkSecurityImpl serviceImpl; + + public MockNetworkSecurity() { + serviceImpl = new MockNetworkSecurityImpl(); + } + + @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-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurityImpl.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurityImpl.java new file mode 100644 index 00000000..ead812b0 --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/MockNetworkSecurityImpl.java @@ -0,0 +1,379 @@ +/* + * 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.cloud.networksecurity.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.networksecurity.v1.NetworkSecurityGrpc.NetworkSecurityImplBase; +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 MockNetworkSecurityImpl extends NetworkSecurityImplBase { + private List requests; + private Queue responses; + + public MockNetworkSecurityImpl() { + 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 listAuthorizationPolicies( + ListAuthorizationPoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAuthorizationPoliciesResponse) { + requests.add(request); + responseObserver.onNext(((ListAuthorizationPoliciesResponse) 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 ListAuthorizationPolicies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAuthorizationPoliciesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAuthorizationPolicy( + GetAuthorizationPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AuthorizationPolicy) { + requests.add(request); + responseObserver.onNext(((AuthorizationPolicy) 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 GetAuthorizationPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AuthorizationPolicy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAuthorizationPolicy( + CreateAuthorizationPolicyRequest 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 CreateAuthorizationPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAuthorizationPolicy( + UpdateAuthorizationPolicyRequest 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 UpdateAuthorizationPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAuthorizationPolicy( + DeleteAuthorizationPolicyRequest 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 DeleteAuthorizationPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listServerTlsPolicies( + ListServerTlsPoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListServerTlsPoliciesResponse) { + requests.add(request); + responseObserver.onNext(((ListServerTlsPoliciesResponse) 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 ListServerTlsPolicies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListServerTlsPoliciesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getServerTlsPolicy( + GetServerTlsPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ServerTlsPolicy) { + requests.add(request); + responseObserver.onNext(((ServerTlsPolicy) 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 GetServerTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ServerTlsPolicy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createServerTlsPolicy( + CreateServerTlsPolicyRequest 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 CreateServerTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateServerTlsPolicy( + UpdateServerTlsPolicyRequest 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 UpdateServerTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteServerTlsPolicy( + DeleteServerTlsPolicyRequest 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 DeleteServerTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listClientTlsPolicies( + ListClientTlsPoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListClientTlsPoliciesResponse) { + requests.add(request); + responseObserver.onNext(((ListClientTlsPoliciesResponse) 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 ListClientTlsPolicies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListClientTlsPoliciesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getClientTlsPolicy( + GetClientTlsPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ClientTlsPolicy) { + requests.add(request); + responseObserver.onNext(((ClientTlsPolicy) 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 GetClientTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ClientTlsPolicy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createClientTlsPolicy( + CreateClientTlsPolicyRequest 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 CreateClientTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateClientTlsPolicy( + UpdateClientTlsPolicyRequest 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 UpdateClientTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteClientTlsPolicy( + DeleteClientTlsPolicyRequest 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 DeleteClientTlsPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/NetworkSecurityClientTest.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/NetworkSecurityClientTest.java new file mode 100644 index 00000000..13ae4ff4 --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1/NetworkSecurityClientTest.java @@ -0,0 +1,1463 @@ +/* + * 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.cloud.networksecurity.v1; + +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +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.Empty; +import com.google.protobuf.FieldMask; +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 NetworkSecurityClientTest { + private static MockNetworkSecurity mockNetworkSecurity; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private NetworkSecurityClient client; + + @BeforeClass + public static void startStaticServer() { + mockNetworkSecurity = new MockNetworkSecurity(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockNetworkSecurity)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + NetworkSecuritySettings settings = + NetworkSecuritySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NetworkSecurityClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listAuthorizationPoliciesTest() throws Exception { + AuthorizationPolicy responsesElement = AuthorizationPolicy.newBuilder().build(); + ListAuthorizationPoliciesResponse expectedResponse = + ListAuthorizationPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizationPolicies(Arrays.asList(responsesElement)) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAuthorizationPoliciesPagedResponse pagedListResponse = + client.listAuthorizationPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizationPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAuthorizationPoliciesRequest actualRequest = + ((ListAuthorizationPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAuthorizationPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAuthorizationPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAuthorizationPoliciesTest2() throws Exception { + AuthorizationPolicy responsesElement = AuthorizationPolicy.newBuilder().build(); + ListAuthorizationPoliciesResponse expectedResponse = + ListAuthorizationPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizationPolicies(Arrays.asList(responsesElement)) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAuthorizationPoliciesPagedResponse pagedListResponse = + client.listAuthorizationPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizationPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAuthorizationPoliciesRequest actualRequest = + ((ListAuthorizationPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAuthorizationPoliciesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAuthorizationPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizationPolicyTest() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + + AuthorizationPolicy actualResponse = client.getAuthorizationPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAuthorizationPolicyRequest actualRequest = + ((GetAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAuthorizationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + client.getAuthorizationPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizationPolicyTest2() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + String name = "name3373707"; + + AuthorizationPolicy actualResponse = client.getAuthorizationPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAuthorizationPolicyRequest actualRequest = + ((GetAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAuthorizationPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String name = "name3373707"; + client.getAuthorizationPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAuthorizationPolicyTest() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + + AuthorizationPolicy actualResponse = + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAuthorizationPolicyRequest actualRequest = + ((CreateAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(authorizationPolicy, actualRequest.getAuthorizationPolicy()); + Assert.assertEquals(authorizationPolicyId, actualRequest.getAuthorizationPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAuthorizationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .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 createAuthorizationPolicyTest2() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + String parent = "parent-995424086"; + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + + AuthorizationPolicy actualResponse = + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAuthorizationPolicyRequest actualRequest = + ((CreateAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(authorizationPolicy, actualRequest.getAuthorizationPolicy()); + Assert.assertEquals(authorizationPolicyId, actualRequest.getAuthorizationPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAuthorizationPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String parent = "parent-995424086"; + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .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 updateAuthorizationPolicyTest() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AuthorizationPolicy actualResponse = + client.updateAuthorizationPolicyAsync(authorizationPolicy, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAuthorizationPolicyRequest actualRequest = + ((UpdateAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(authorizationPolicy, actualRequest.getAuthorizationPolicy()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAuthorizationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAuthorizationPolicyAsync(authorizationPolicy, updateMask).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 deleteAuthorizationPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + + client.deleteAuthorizationPolicyAsync(name).get(); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAuthorizationPolicyRequest actualRequest = + ((DeleteAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAuthorizationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + client.deleteAuthorizationPolicyAsync(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 deleteAuthorizationPolicyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteAuthorizationPolicyAsync(name).get(); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAuthorizationPolicyRequest actualRequest = + ((DeleteAuthorizationPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAuthorizationPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String name = "name3373707"; + client.deleteAuthorizationPolicyAsync(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 listServerTlsPoliciesTest() throws Exception { + ServerTlsPolicy responsesElement = ServerTlsPolicy.newBuilder().build(); + ListServerTlsPoliciesResponse expectedResponse = + ListServerTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllServerTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListServerTlsPoliciesPagedResponse pagedListResponse = client.listServerTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServerTlsPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServerTlsPoliciesRequest actualRequest = + ((ListServerTlsPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServerTlsPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listServerTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerTlsPoliciesTest2() throws Exception { + ServerTlsPolicy responsesElement = ServerTlsPolicy.newBuilder().build(); + ListServerTlsPoliciesResponse expectedResponse = + ListServerTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllServerTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListServerTlsPoliciesPagedResponse pagedListResponse = client.listServerTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServerTlsPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServerTlsPoliciesRequest actualRequest = + ((ListServerTlsPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listServerTlsPoliciesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String parent = "parent-995424086"; + client.listServerTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServerTlsPolicyTest() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + + ServerTlsPolicy actualResponse = client.getServerTlsPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServerTlsPolicyRequest actualRequest = ((GetServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getServerTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + client.getServerTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServerTlsPolicyTest2() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + String name = "name3373707"; + + ServerTlsPolicy actualResponse = client.getServerTlsPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServerTlsPolicyRequest actualRequest = ((GetServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getServerTlsPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String name = "name3373707"; + client.getServerTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createServerTlsPolicyTest() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + + ServerTlsPolicy actualResponse = + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServerTlsPolicyRequest actualRequest = + ((CreateServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(serverTlsPolicy, actualRequest.getServerTlsPolicy()); + Assert.assertEquals(serverTlsPolicyId, actualRequest.getServerTlsPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createServerTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).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 createServerTlsPolicyTest2() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + String parent = "parent-995424086"; + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + + ServerTlsPolicy actualResponse = + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServerTlsPolicyRequest actualRequest = + ((CreateServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(serverTlsPolicy, actualRequest.getServerTlsPolicy()); + Assert.assertEquals(serverTlsPolicyId, actualRequest.getServerTlsPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createServerTlsPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String parent = "parent-995424086"; + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).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 updateServerTlsPolicyTest() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ServerTlsPolicy actualResponse = + client.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateServerTlsPolicyRequest actualRequest = + ((UpdateServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(serverTlsPolicy, actualRequest.getServerTlsPolicy()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateServerTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).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 deleteServerTlsPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + + client.deleteServerTlsPolicyAsync(name).get(); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServerTlsPolicyRequest actualRequest = + ((DeleteServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteServerTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + client.deleteServerTlsPolicyAsync(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 deleteServerTlsPolicyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteServerTlsPolicyAsync(name).get(); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServerTlsPolicyRequest actualRequest = + ((DeleteServerTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteServerTlsPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String name = "name3373707"; + client.deleteServerTlsPolicyAsync(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 listClientTlsPoliciesTest() throws Exception { + ClientTlsPolicy responsesElement = ClientTlsPolicy.newBuilder().build(); + ListClientTlsPoliciesResponse expectedResponse = + ListClientTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllClientTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClientTlsPoliciesPagedResponse pagedListResponse = client.listClientTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClientTlsPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClientTlsPoliciesRequest actualRequest = + ((ListClientTlsPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClientTlsPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listClientTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClientTlsPoliciesTest2() throws Exception { + ClientTlsPolicy responsesElement = ClientTlsPolicy.newBuilder().build(); + ListClientTlsPoliciesResponse expectedResponse = + ListClientTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllClientTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListClientTlsPoliciesPagedResponse pagedListResponse = client.listClientTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClientTlsPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListClientTlsPoliciesRequest actualRequest = + ((ListClientTlsPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listClientTlsPoliciesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String parent = "parent-995424086"; + client.listClientTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClientTlsPolicyTest() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + + ClientTlsPolicy actualResponse = client.getClientTlsPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClientTlsPolicyRequest actualRequest = ((GetClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClientTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + client.getClientTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClientTlsPolicyTest2() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + mockNetworkSecurity.addResponse(expectedResponse); + + String name = "name3373707"; + + ClientTlsPolicy actualResponse = client.getClientTlsPolicy(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetClientTlsPolicyRequest actualRequest = ((GetClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getClientTlsPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String name = "name3373707"; + client.getClientTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClientTlsPolicyTest() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + + ClientTlsPolicy actualResponse = + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClientTlsPolicyRequest actualRequest = + ((CreateClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(clientTlsPolicy, actualRequest.getClientTlsPolicy()); + Assert.assertEquals(clientTlsPolicyId, actualRequest.getClientTlsPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClientTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).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 createClientTlsPolicyTest2() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + String parent = "parent-995424086"; + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + + ClientTlsPolicy actualResponse = + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateClientTlsPolicyRequest actualRequest = + ((CreateClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(clientTlsPolicy, actualRequest.getClientTlsPolicy()); + Assert.assertEquals(clientTlsPolicyId, actualRequest.getClientTlsPolicyId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createClientTlsPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String parent = "parent-995424086"; + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).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 updateClientTlsPolicyTest() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ClientTlsPolicy actualResponse = + client.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateClientTlsPolicyRequest actualRequest = + ((UpdateClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(clientTlsPolicy, actualRequest.getClientTlsPolicy()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateClientTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).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 deleteClientTlsPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + + client.deleteClientTlsPolicyAsync(name).get(); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClientTlsPolicyRequest actualRequest = + ((DeleteClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClientTlsPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + client.deleteClientTlsPolicyAsync(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 deleteClientTlsPolicyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockNetworkSecurity.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClientTlsPolicyAsync(name).get(); + + List actualRequests = mockNetworkSecurity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteClientTlsPolicyRequest actualRequest = + ((DeleteClientTlsPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteClientTlsPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockNetworkSecurity.addException(exception); + + try { + String name = "name3373707"; + client.deleteClientTlsPolicyAsync(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()); + } + } +} diff --git a/grpc-google-cloud-network-security-v1/pom.xml b/grpc-google-cloud-network-security-v1/pom.xml new file mode 100644 index 00000000..6edf2cda --- /dev/null +++ b/grpc-google-cloud-network-security-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-network-security-v1 + 0.5.2-SNAPSHOT + grpc-google-cloud-network-security-v1 + GRPC library for google-cloud-network-security + + com.google.cloud + google-cloud-network-security-parent + 0.5.2-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-cloud-network-security-v1 + + + 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-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityGrpc.java b/grpc-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityGrpc.java new file mode 100644 index 00000000..d32cae5f --- /dev/null +++ b/grpc-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityGrpc.java @@ -0,0 +1,2088 @@ +/* + * 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.cloud.networksecurity.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Network Security API provides resources to configure authentication and
+ * authorization policies. Refer to per API resource documentation for more
+ * information.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/networksecurity/v1/network_security.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class NetworkSecurityGrpc { + + private NetworkSecurityGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.networksecurity.v1.NetworkSecurity"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse> + getListAuthorizationPoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAuthorizationPolicies", + requestType = com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest.class, + responseType = com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse> + getListAuthorizationPoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse> + getListAuthorizationPoliciesMethod; + if ((getListAuthorizationPoliciesMethod = + NetworkSecurityGrpc.getListAuthorizationPoliciesMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getListAuthorizationPoliciesMethod = + NetworkSecurityGrpc.getListAuthorizationPoliciesMethod) + == null) { + NetworkSecurityGrpc.getListAuthorizationPoliciesMethod = + getListAuthorizationPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAuthorizationPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("ListAuthorizationPolicies")) + .build(); + } + } + } + return getListAuthorizationPoliciesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest, + com.google.cloud.networksecurity.v1.AuthorizationPolicy> + getGetAuthorizationPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAuthorizationPolicy", + requestType = com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.class, + responseType = com.google.cloud.networksecurity.v1.AuthorizationPolicy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest, + com.google.cloud.networksecurity.v1.AuthorizationPolicy> + getGetAuthorizationPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest, + com.google.cloud.networksecurity.v1.AuthorizationPolicy> + getGetAuthorizationPolicyMethod; + if ((getGetAuthorizationPolicyMethod = NetworkSecurityGrpc.getGetAuthorizationPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getGetAuthorizationPolicyMethod = NetworkSecurityGrpc.getGetAuthorizationPolicyMethod) + == null) { + NetworkSecurityGrpc.getGetAuthorizationPolicyMethod = + getGetAuthorizationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetAuthorizationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.AuthorizationPolicy + .getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("GetAuthorizationPolicy")) + .build(); + } + } + } + return getGetAuthorizationPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getCreateAuthorizationPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAuthorizationPolicy", + requestType = com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getCreateAuthorizationPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getCreateAuthorizationPolicyMethod; + if ((getCreateAuthorizationPolicyMethod = + NetworkSecurityGrpc.getCreateAuthorizationPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getCreateAuthorizationPolicyMethod = + NetworkSecurityGrpc.getCreateAuthorizationPolicyMethod) + == null) { + NetworkSecurityGrpc.getCreateAuthorizationPolicyMethod = + getCreateAuthorizationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateAuthorizationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("CreateAuthorizationPolicy")) + .build(); + } + } + } + return getCreateAuthorizationPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAuthorizationPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAuthorizationPolicy", + requestType = com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAuthorizationPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAuthorizationPolicyMethod; + if ((getUpdateAuthorizationPolicyMethod = + NetworkSecurityGrpc.getUpdateAuthorizationPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getUpdateAuthorizationPolicyMethod = + NetworkSecurityGrpc.getUpdateAuthorizationPolicyMethod) + == null) { + NetworkSecurityGrpc.getUpdateAuthorizationPolicyMethod = + getUpdateAuthorizationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateAuthorizationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("UpdateAuthorizationPolicy")) + .build(); + } + } + } + return getUpdateAuthorizationPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAuthorizationPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAuthorizationPolicy", + requestType = com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAuthorizationPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAuthorizationPolicyMethod; + if ((getDeleteAuthorizationPolicyMethod = + NetworkSecurityGrpc.getDeleteAuthorizationPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getDeleteAuthorizationPolicyMethod = + NetworkSecurityGrpc.getDeleteAuthorizationPolicyMethod) + == null) { + NetworkSecurityGrpc.getDeleteAuthorizationPolicyMethod = + getDeleteAuthorizationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteAuthorizationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("DeleteAuthorizationPolicy")) + .build(); + } + } + } + return getDeleteAuthorizationPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse> + getListServerTlsPoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServerTlsPolicies", + requestType = com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.class, + responseType = com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse> + getListServerTlsPoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse> + getListServerTlsPoliciesMethod; + if ((getListServerTlsPoliciesMethod = NetworkSecurityGrpc.getListServerTlsPoliciesMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getListServerTlsPoliciesMethod = NetworkSecurityGrpc.getListServerTlsPoliciesMethod) + == null) { + NetworkSecurityGrpc.getListServerTlsPoliciesMethod = + getListServerTlsPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListServerTlsPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("ListServerTlsPolicies")) + .build(); + } + } + } + return getListServerTlsPoliciesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ServerTlsPolicy> + getGetServerTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetServerTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.class, + responseType = com.google.cloud.networksecurity.v1.ServerTlsPolicy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ServerTlsPolicy> + getGetServerTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ServerTlsPolicy> + getGetServerTlsPolicyMethod; + if ((getGetServerTlsPolicyMethod = NetworkSecurityGrpc.getGetServerTlsPolicyMethod) == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getGetServerTlsPolicyMethod = NetworkSecurityGrpc.getGetServerTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getGetServerTlsPolicyMethod = + getGetServerTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetServerTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ServerTlsPolicy + .getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("GetServerTlsPolicy")) + .build(); + } + } + } + return getGetServerTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, + com.google.longrunning.Operation> + getCreateServerTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateServerTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, + com.google.longrunning.Operation> + getCreateServerTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, + com.google.longrunning.Operation> + getCreateServerTlsPolicyMethod; + if ((getCreateServerTlsPolicyMethod = NetworkSecurityGrpc.getCreateServerTlsPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getCreateServerTlsPolicyMethod = NetworkSecurityGrpc.getCreateServerTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getCreateServerTlsPolicyMethod = + getCreateServerTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateServerTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("CreateServerTlsPolicy")) + .build(); + } + } + } + return getCreateServerTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, + com.google.longrunning.Operation> + getUpdateServerTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateServerTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, + com.google.longrunning.Operation> + getUpdateServerTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, + com.google.longrunning.Operation> + getUpdateServerTlsPolicyMethod; + if ((getUpdateServerTlsPolicyMethod = NetworkSecurityGrpc.getUpdateServerTlsPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getUpdateServerTlsPolicyMethod = NetworkSecurityGrpc.getUpdateServerTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getUpdateServerTlsPolicyMethod = + getUpdateServerTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateServerTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("UpdateServerTlsPolicy")) + .build(); + } + } + } + return getUpdateServerTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, + com.google.longrunning.Operation> + getDeleteServerTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteServerTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, + com.google.longrunning.Operation> + getDeleteServerTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, + com.google.longrunning.Operation> + getDeleteServerTlsPolicyMethod; + if ((getDeleteServerTlsPolicyMethod = NetworkSecurityGrpc.getDeleteServerTlsPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getDeleteServerTlsPolicyMethod = NetworkSecurityGrpc.getDeleteServerTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getDeleteServerTlsPolicyMethod = + getDeleteServerTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteServerTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("DeleteServerTlsPolicy")) + .build(); + } + } + } + return getDeleteServerTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse> + getListClientTlsPoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClientTlsPolicies", + requestType = com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.class, + responseType = com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse> + getListClientTlsPoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse> + getListClientTlsPoliciesMethod; + if ((getListClientTlsPoliciesMethod = NetworkSecurityGrpc.getListClientTlsPoliciesMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getListClientTlsPoliciesMethod = NetworkSecurityGrpc.getListClientTlsPoliciesMethod) + == null) { + NetworkSecurityGrpc.getListClientTlsPoliciesMethod = + getListClientTlsPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListClientTlsPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("ListClientTlsPolicies")) + .build(); + } + } + } + return getListClientTlsPoliciesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ClientTlsPolicy> + getGetClientTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetClientTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.class, + responseType = com.google.cloud.networksecurity.v1.ClientTlsPolicy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ClientTlsPolicy> + getGetClientTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ClientTlsPolicy> + getGetClientTlsPolicyMethod; + if ((getGetClientTlsPolicyMethod = NetworkSecurityGrpc.getGetClientTlsPolicyMethod) == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getGetClientTlsPolicyMethod = NetworkSecurityGrpc.getGetClientTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getGetClientTlsPolicyMethod = + getGetClientTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetClientTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.ClientTlsPolicy + .getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("GetClientTlsPolicy")) + .build(); + } + } + } + return getGetClientTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, + com.google.longrunning.Operation> + getCreateClientTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateClientTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, + com.google.longrunning.Operation> + getCreateClientTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, + com.google.longrunning.Operation> + getCreateClientTlsPolicyMethod; + if ((getCreateClientTlsPolicyMethod = NetworkSecurityGrpc.getCreateClientTlsPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getCreateClientTlsPolicyMethod = NetworkSecurityGrpc.getCreateClientTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getCreateClientTlsPolicyMethod = + getCreateClientTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateClientTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("CreateClientTlsPolicy")) + .build(); + } + } + } + return getCreateClientTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, + com.google.longrunning.Operation> + getUpdateClientTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateClientTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, + com.google.longrunning.Operation> + getUpdateClientTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, + com.google.longrunning.Operation> + getUpdateClientTlsPolicyMethod; + if ((getUpdateClientTlsPolicyMethod = NetworkSecurityGrpc.getUpdateClientTlsPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getUpdateClientTlsPolicyMethod = NetworkSecurityGrpc.getUpdateClientTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getUpdateClientTlsPolicyMethod = + getUpdateClientTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateClientTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("UpdateClientTlsPolicy")) + .build(); + } + } + } + return getUpdateClientTlsPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, + com.google.longrunning.Operation> + getDeleteClientTlsPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteClientTlsPolicy", + requestType = com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, + com.google.longrunning.Operation> + getDeleteClientTlsPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, + com.google.longrunning.Operation> + getDeleteClientTlsPolicyMethod; + if ((getDeleteClientTlsPolicyMethod = NetworkSecurityGrpc.getDeleteClientTlsPolicyMethod) + == null) { + synchronized (NetworkSecurityGrpc.class) { + if ((getDeleteClientTlsPolicyMethod = NetworkSecurityGrpc.getDeleteClientTlsPolicyMethod) + == null) { + NetworkSecurityGrpc.getDeleteClientTlsPolicyMethod = + getDeleteClientTlsPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteClientTlsPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new NetworkSecurityMethodDescriptorSupplier("DeleteClientTlsPolicy")) + .build(); + } + } + } + return getDeleteClientTlsPolicyMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static NetworkSecurityStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NetworkSecurityStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NetworkSecurityStub(channel, callOptions); + } + }; + return NetworkSecurityStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static NetworkSecurityBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NetworkSecurityBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NetworkSecurityBlockingStub(channel, callOptions); + } + }; + return NetworkSecurityBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static NetworkSecurityFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public NetworkSecurityFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NetworkSecurityFutureStub(channel, callOptions); + } + }; + return NetworkSecurityFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Network Security API provides resources to configure authentication and
+   * authorization policies. Refer to per API resource documentation for more
+   * information.
+   * 
+ */ + public abstract static class NetworkSecurityImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists AuthorizationPolicies in a given project and location.
+     * 
+ */ + public void listAuthorizationPolicies( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAuthorizationPoliciesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single AuthorizationPolicy.
+     * 
+ */ + public void getAuthorizationPolicy( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAuthorizationPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new AuthorizationPolicy in a given project and location.
+     * 
+ */ + public void createAuthorizationPolicy( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAuthorizationPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single AuthorizationPolicy.
+     * 
+ */ + public void updateAuthorizationPolicy( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAuthorizationPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single AuthorizationPolicy.
+     * 
+ */ + public void deleteAuthorizationPolicy( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAuthorizationPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists ServerTlsPolicies in a given project and location.
+     * 
+ */ + public void listServerTlsPolicies( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListServerTlsPoliciesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ServerTlsPolicy.
+     * 
+ */ + public void getServerTlsPolicy( + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetServerTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new ServerTlsPolicy in a given project and location.
+     * 
+ */ + public void createServerTlsPolicy( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateServerTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single ServerTlsPolicy.
+     * 
+ */ + public void updateServerTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateServerTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single ServerTlsPolicy.
+     * 
+ */ + public void deleteServerTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteServerTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists ClientTlsPolicies in a given project and location.
+     * 
+ */ + public void listClientTlsPolicies( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClientTlsPoliciesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ClientTlsPolicy.
+     * 
+ */ + public void getClientTlsPolicy( + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetClientTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new ClientTlsPolicy in a given project and location.
+     * 
+ */ + public void createClientTlsPolicy( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClientTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single ClientTlsPolicy.
+     * 
+ */ + public void updateClientTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClientTlsPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single ClientTlsPolicy.
+     * 
+ */ + public void deleteClientTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClientTlsPolicyMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListAuthorizationPoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse>( + this, METHODID_LIST_AUTHORIZATION_POLICIES))) + .addMethod( + getGetAuthorizationPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest, + com.google.cloud.networksecurity.v1.AuthorizationPolicy>( + this, METHODID_GET_AUTHORIZATION_POLICY))) + .addMethod( + getCreateAuthorizationPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest, + com.google.longrunning.Operation>( + this, METHODID_CREATE_AUTHORIZATION_POLICY))) + .addMethod( + getUpdateAuthorizationPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest, + com.google.longrunning.Operation>( + this, METHODID_UPDATE_AUTHORIZATION_POLICY))) + .addMethod( + getDeleteAuthorizationPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest, + com.google.longrunning.Operation>( + this, METHODID_DELETE_AUTHORIZATION_POLICY))) + .addMethod( + getListServerTlsPoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse>( + this, METHODID_LIST_SERVER_TLS_POLICIES))) + .addMethod( + getGetServerTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ServerTlsPolicy>( + this, METHODID_GET_SERVER_TLS_POLICY))) + .addMethod( + getCreateServerTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SERVER_TLS_POLICY))) + .addMethod( + getUpdateServerTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_SERVER_TLS_POLICY))) + .addMethod( + getDeleteServerTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_SERVER_TLS_POLICY))) + .addMethod( + getListClientTlsPoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse>( + this, METHODID_LIST_CLIENT_TLS_POLICIES))) + .addMethod( + getGetClientTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, + com.google.cloud.networksecurity.v1.ClientTlsPolicy>( + this, METHODID_GET_CLIENT_TLS_POLICY))) + .addMethod( + getCreateClientTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_CLIENT_TLS_POLICY))) + .addMethod( + getUpdateClientTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_CLIENT_TLS_POLICY))) + .addMethod( + getDeleteClientTlsPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_CLIENT_TLS_POLICY))) + .build(); + } + } + + /** + * + * + *
+   * Network Security API provides resources to configure authentication and
+   * authorization policies. Refer to per API resource documentation for more
+   * information.
+   * 
+ */ + public static final class NetworkSecurityStub + extends io.grpc.stub.AbstractAsyncStub { + private NetworkSecurityStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NetworkSecurityStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NetworkSecurityStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AuthorizationPolicies in a given project and location.
+     * 
+ */ + public void listAuthorizationPolicies( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAuthorizationPoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single AuthorizationPolicy.
+     * 
+ */ + public void getAuthorizationPolicy( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAuthorizationPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new AuthorizationPolicy in a given project and location.
+     * 
+ */ + public void createAuthorizationPolicy( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAuthorizationPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single AuthorizationPolicy.
+     * 
+ */ + public void updateAuthorizationPolicy( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAuthorizationPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single AuthorizationPolicy.
+     * 
+ */ + public void deleteAuthorizationPolicy( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAuthorizationPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists ServerTlsPolicies in a given project and location.
+     * 
+ */ + public void listServerTlsPolicies( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListServerTlsPoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ServerTlsPolicy.
+     * 
+ */ + public void getServerTlsPolicy( + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetServerTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new ServerTlsPolicy in a given project and location.
+     * 
+ */ + public void createServerTlsPolicy( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateServerTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single ServerTlsPolicy.
+     * 
+ */ + public void updateServerTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateServerTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single ServerTlsPolicy.
+     * 
+ */ + public void deleteServerTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteServerTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists ClientTlsPolicies in a given project and location.
+     * 
+ */ + public void listClientTlsPolicies( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClientTlsPoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ClientTlsPolicy.
+     * 
+ */ + public void getClientTlsPolicy( + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClientTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new ClientTlsPolicy in a given project and location.
+     * 
+ */ + public void createClientTlsPolicy( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClientTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single ClientTlsPolicy.
+     * 
+ */ + public void updateClientTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClientTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single ClientTlsPolicy.
+     * 
+ */ + public void deleteClientTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClientTlsPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Network Security API provides resources to configure authentication and
+   * authorization policies. Refer to per API resource documentation for more
+   * information.
+   * 
+ */ + public static final class NetworkSecurityBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private NetworkSecurityBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NetworkSecurityBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NetworkSecurityBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AuthorizationPolicies in a given project and location.
+     * 
+ */ + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + listAuthorizationPolicies( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAuthorizationPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single AuthorizationPolicy.
+     * 
+ */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAuthorizationPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new AuthorizationPolicy in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createAuthorizationPolicy( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAuthorizationPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single AuthorizationPolicy.
+     * 
+ */ + public com.google.longrunning.Operation updateAuthorizationPolicy( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAuthorizationPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single AuthorizationPolicy.
+     * 
+ */ + public com.google.longrunning.Operation deleteAuthorizationPolicy( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAuthorizationPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists ServerTlsPolicies in a given project and location.
+     * 
+ */ + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse listServerTlsPolicies( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListServerTlsPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single ServerTlsPolicy.
+     * 
+ */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy( + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetServerTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new ServerTlsPolicy in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createServerTlsPolicy( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateServerTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single ServerTlsPolicy.
+     * 
+ */ + public com.google.longrunning.Operation updateServerTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateServerTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single ServerTlsPolicy.
+     * 
+ */ + public com.google.longrunning.Operation deleteServerTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteServerTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists ClientTlsPolicies in a given project and location.
+     * 
+ */ + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse listClientTlsPolicies( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClientTlsPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single ClientTlsPolicy.
+     * 
+ */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy( + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClientTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new ClientTlsPolicy in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createClientTlsPolicy( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClientTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single ClientTlsPolicy.
+     * 
+ */ + public com.google.longrunning.Operation updateClientTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClientTlsPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single ClientTlsPolicy.
+     * 
+ */ + public com.google.longrunning.Operation deleteClientTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClientTlsPolicyMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Network Security API provides resources to configure authentication and
+   * authorization policies. Refer to per API resource documentation for more
+   * information.
+   * 
+ */ + public static final class NetworkSecurityFutureStub + extends io.grpc.stub.AbstractFutureStub { + private NetworkSecurityFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected NetworkSecurityFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new NetworkSecurityFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AuthorizationPolicies in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse> + listAuthorizationPolicies( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAuthorizationPoliciesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single AuthorizationPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networksecurity.v1.AuthorizationPolicy> + getAuthorizationPolicy( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAuthorizationPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new AuthorizationPolicy in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAuthorizationPolicy( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAuthorizationPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single AuthorizationPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateAuthorizationPolicy( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAuthorizationPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single AuthorizationPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAuthorizationPolicy( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAuthorizationPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists ServerTlsPolicies in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse> + listServerTlsPolicies( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListServerTlsPoliciesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single ServerTlsPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networksecurity.v1.ServerTlsPolicy> + getServerTlsPolicy(com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetServerTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new ServerTlsPolicy in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createServerTlsPolicy( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateServerTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single ServerTlsPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateServerTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateServerTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single ServerTlsPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteServerTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteServerTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists ClientTlsPolicies in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse> + listClientTlsPolicies( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClientTlsPoliciesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single ClientTlsPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networksecurity.v1.ClientTlsPolicy> + getClientTlsPolicy(com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClientTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new ClientTlsPolicy in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createClientTlsPolicy( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClientTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single ClientTlsPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateClientTlsPolicy( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClientTlsPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single ClientTlsPolicy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteClientTlsPolicy( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClientTlsPolicyMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_AUTHORIZATION_POLICIES = 0; + private static final int METHODID_GET_AUTHORIZATION_POLICY = 1; + private static final int METHODID_CREATE_AUTHORIZATION_POLICY = 2; + private static final int METHODID_UPDATE_AUTHORIZATION_POLICY = 3; + private static final int METHODID_DELETE_AUTHORIZATION_POLICY = 4; + private static final int METHODID_LIST_SERVER_TLS_POLICIES = 5; + private static final int METHODID_GET_SERVER_TLS_POLICY = 6; + private static final int METHODID_CREATE_SERVER_TLS_POLICY = 7; + private static final int METHODID_UPDATE_SERVER_TLS_POLICY = 8; + private static final int METHODID_DELETE_SERVER_TLS_POLICY = 9; + private static final int METHODID_LIST_CLIENT_TLS_POLICIES = 10; + private static final int METHODID_GET_CLIENT_TLS_POLICY = 11; + private static final int METHODID_CREATE_CLIENT_TLS_POLICY = 12; + private static final int METHODID_UPDATE_CLIENT_TLS_POLICY = 13; + private static final int METHODID_DELETE_CLIENT_TLS_POLICY = 14; + + 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 NetworkSecurityImplBase serviceImpl; + private final int methodId; + + MethodHandlers(NetworkSecurityImplBase 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_AUTHORIZATION_POLICIES: + serviceImpl.listAuthorizationPolicies( + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse>) + responseObserver); + break; + case METHODID_GET_AUTHORIZATION_POLICY: + serviceImpl.getAuthorizationPolicy( + (com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_AUTHORIZATION_POLICY: + serviceImpl.createAuthorizationPolicy( + (com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_AUTHORIZATION_POLICY: + serviceImpl.updateAuthorizationPolicy( + (com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_AUTHORIZATION_POLICY: + serviceImpl.deleteAuthorizationPolicy( + (com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SERVER_TLS_POLICIES: + serviceImpl.listServerTlsPolicies( + (com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse>) + responseObserver); + break; + case METHODID_GET_SERVER_TLS_POLICY: + serviceImpl.getServerTlsPolicy( + (com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SERVER_TLS_POLICY: + serviceImpl.createServerTlsPolicy( + (com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SERVER_TLS_POLICY: + serviceImpl.updateServerTlsPolicy( + (com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SERVER_TLS_POLICY: + serviceImpl.deleteServerTlsPolicy( + (com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CLIENT_TLS_POLICIES: + serviceImpl.listClientTlsPolicies( + (com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse>) + responseObserver); + break; + case METHODID_GET_CLIENT_TLS_POLICY: + serviceImpl.getClientTlsPolicy( + (com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_CLIENT_TLS_POLICY: + serviceImpl.createClientTlsPolicy( + (com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CLIENT_TLS_POLICY: + serviceImpl.updateClientTlsPolicy( + (com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLIENT_TLS_POLICY: + serviceImpl.deleteClientTlsPolicy( + (com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) 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 NetworkSecurityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + NetworkSecurityBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.networksecurity.v1.NetworkSecurityOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("NetworkSecurity"); + } + } + + private static final class NetworkSecurityFileDescriptorSupplier + extends NetworkSecurityBaseDescriptorSupplier { + NetworkSecurityFileDescriptorSupplier() {} + } + + private static final class NetworkSecurityMethodDescriptorSupplier + extends NetworkSecurityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + NetworkSecurityMethodDescriptorSupplier(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 (NetworkSecurityGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new NetworkSecurityFileDescriptorSupplier()) + .addMethod(getListAuthorizationPoliciesMethod()) + .addMethod(getGetAuthorizationPolicyMethod()) + .addMethod(getCreateAuthorizationPolicyMethod()) + .addMethod(getUpdateAuthorizationPolicyMethod()) + .addMethod(getDeleteAuthorizationPolicyMethod()) + .addMethod(getListServerTlsPoliciesMethod()) + .addMethod(getGetServerTlsPolicyMethod()) + .addMethod(getCreateServerTlsPolicyMethod()) + .addMethod(getUpdateServerTlsPolicyMethod()) + .addMethod(getDeleteServerTlsPolicyMethod()) + .addMethod(getListClientTlsPoliciesMethod()) + .addMethod(getGetClientTlsPolicyMethod()) + .addMethod(getCreateClientTlsPolicyMethod()) + .addMethod(getUpdateClientTlsPolicyMethod()) + .addMethod(getDeleteClientTlsPolicyMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 79606174..a2ef4fe5 100644 --- a/pom.xml +++ b/pom.xml @@ -71,6 +71,16 @@ google-cloud-network-security 0.5.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-network-security-v1 + 0.5.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-network-security-v1 + 0.5.2-SNAPSHOT + com.google.api.grpc grpc-google-cloud-network-security-v1beta1 @@ -112,7 +122,9 @@ google-cloud-network-security grpc-google-cloud-network-security-v1beta1 + grpc-google-cloud-network-security-v1 proto-google-cloud-network-security-v1beta1 + proto-google-cloud-network-security-v1 google-cloud-network-security-bom diff --git a/proto-google-cloud-network-security-v1/clirr-ignored-differences.xml b/proto-google-cloud-network-security-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..fa9ab144 --- /dev/null +++ b/proto-google-cloud-network-security-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/networksecurity/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/networksecurity/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/networksecurity/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-network-security-v1/pom.xml b/proto-google-cloud-network-security-v1/pom.xml new file mode 100644 index 00000000..601ec36e --- /dev/null +++ b/proto-google-cloud-network-security-v1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-network-security-v1 + 0.5.2-SNAPSHOT + proto-google-cloud-network-security-v1 + Proto library for google-cloud-network-security + + com.google.cloud + google-cloud-network-security-parent + 0.5.2-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicy.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicy.java new file mode 100644 index 00000000..0f4d9c5d --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicy.java @@ -0,0 +1,9033 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * AuthorizationPolicy is a resource that specifies how a server
+ * should authorize incoming connections. This resource in itself does
+ * not change the configuration unless it's attached to a target https
+ * proxy or endpoint config selector resource.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy} + */ +public final class AuthorizationPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.AuthorizationPolicy) + AuthorizationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthorizationPolicy.newBuilder() to construct. + private AuthorizationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthorizationPolicy() { + name_ = ""; + description_ = ""; + action_ = 0; + rules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthorizationPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AuthorizationPolicy( + 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(); + + description_ = s; + break; + } + case 26: + { + 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 34: + { + 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 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 48: + { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + rules_ = + new java.util.ArrayList< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule>(); + mutable_bitField0_ |= 0x00000002; + } + rules_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.parser(), + extensionRegistry)); + 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder.class); + } + + /** + * + * + *
+   * Possible values that define what action to take.
+   * 
+ * + * Protobuf enum {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Action} + */ + public enum Action implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value.
+     * 
+ * + * ACTION_UNSPECIFIED = 0; + */ + ACTION_UNSPECIFIED(0), + /** + * + * + *
+     * Grant access.
+     * 
+ * + * ALLOW = 1; + */ + ALLOW(1), + /** + * + * + *
+     * Deny access.
+     * Deny rules should be avoided unless they are used to provide a default
+     * "deny all" fallback.
+     * 
+ * + * DENY = 2; + */ + DENY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value.
+     * 
+ * + * ACTION_UNSPECIFIED = 0; + */ + public static final int ACTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Grant access.
+     * 
+ * + * ALLOW = 1; + */ + public static final int ALLOW_VALUE = 1; + /** + * + * + *
+     * Deny access.
+     * Deny rules should be avoided unless they are used to provide a default
+     * "deny all" fallback.
+     * 
+ * + * DENY = 2; + */ + public static final int DENY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Action valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Action forNumber(int value) { + switch (value) { + case 0: + return ACTION_UNSPECIFIED; + case 1: + return ALLOW; + case 2: + return DENY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Action findValueByNumber(int number) { + return Action.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Action[] VALUES = values(); + + public static Action valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Action(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.networksecurity.v1.AuthorizationPolicy.Action) + } + + public interface RuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSourcesList(); + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source getSources(int index); + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSourcesCount(); + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List< + ? extends com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder> + getSourcesOrBuilderList(); + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder + getSourcesOrBuilder(int index); + + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getDestinationsList(); + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination getDestinations( + int index); + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getDestinationsCount(); + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List< + ? extends + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder> + getDestinationsOrBuilderList(); + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder + getDestinationsOrBuilder(int index); + } + /** + * + * + *
+   * Specification of rules.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Rule} + */ + public static final class Rule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) + RuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Rule.newBuilder() to construct. + private Rule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Rule() { + sources_ = java.util.Collections.emptyList(); + destinations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Rule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Rule( + 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)) { + sources_ = + new java.util.ArrayList< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source>(); + mutable_bitField0_ |= 0x00000001; + } + sources_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + .parser(), + extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + destinations_ = + new java.util.ArrayList< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule + .Destination>(); + mutable_bitField0_ |= 0x00000002; + } + destinations_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .parser(), + extensionRegistry)); + 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)) { + sources_ = java.util.Collections.unmodifiableList(sources_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + destinations_ = java.util.Collections.unmodifiableList(destinations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder.class); + } + + public interface SourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the principals. + */ + java.util.List getPrincipalsList(); + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of principals. + */ + int getPrincipalsCount(); + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The principals at the given index. + */ + java.lang.String getPrincipals(int index); + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the principals at the given index. + */ + com.google.protobuf.ByteString getPrincipalsBytes(int index); + + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the ipBlocks. + */ + java.util.List getIpBlocksList(); + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of ipBlocks. + */ + int getIpBlocksCount(); + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The ipBlocks at the given index. + */ + java.lang.String getIpBlocks(int index); + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the ipBlocks at the given index. + */ + com.google.protobuf.ByteString getIpBlocksBytes(int index); + } + /** + * + * + *
+     * Specification of traffic source attributes.
+     * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source} + */ + public static final class Source extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) + SourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Source() { + principals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ipBlocks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Source(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Source( + 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)) { + principals_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + principals_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ipBlocks_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ipBlocks_.add(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)) { + principals_ = principals_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ipBlocks_ = ipBlocks_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder.class); + } + + public static final int PRINCIPALS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList principals_; + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the principals. + */ + public com.google.protobuf.ProtocolStringList getPrincipalsList() { + return principals_; + } + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of principals. + */ + public int getPrincipalsCount() { + return principals_.size(); + } + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The principals at the given index. + */ + public java.lang.String getPrincipals(int index) { + return principals_.get(index); + } + /** + * + * + *
+       * Optional. List of peer identities to match for authorization. At least one
+       * principal should match. Each peer can be an exact match, or a prefix
+       * match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
+       * ServerTlsPolicy resource) is considered insecure.
+       * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the principals at the given index. + */ + public com.google.protobuf.ByteString getPrincipalsBytes(int index) { + return principals_.getByteString(index); + } + + public static final int IP_BLOCKS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ipBlocks_; + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the ipBlocks. + */ + public com.google.protobuf.ProtocolStringList getIpBlocksList() { + return ipBlocks_; + } + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of ipBlocks. + */ + public int getIpBlocksCount() { + return ipBlocks_.size(); + } + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The ipBlocks at the given index. + */ + public java.lang.String getIpBlocks(int index) { + return ipBlocks_.get(index); + } + /** + * + * + *
+       * Optional. List of CIDR ranges to match based on source IP address. At least one
+       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+       * "1.2.3.0/24") are supported. Authorization based on source IP alone
+       * should be avoided. The IP addresses of any load balancers or proxies
+       * should be considered untrusted.
+       * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the ipBlocks at the given index. + */ + public com.google.protobuf.ByteString getIpBlocksBytes(int index) { + return ipBlocks_.getByteString(index); + } + + 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 < principals_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principals_.getRaw(i)); + } + for (int i = 0; i < ipBlocks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipBlocks_.getRaw(i)); + } + 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 < principals_.size(); i++) { + dataSize += computeStringSizeNoTag(principals_.getRaw(i)); + } + size += dataSize; + size += 1 * getPrincipalsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ipBlocks_.size(); i++) { + dataSize += computeStringSizeNoTag(ipBlocks_.getRaw(i)); + } + size += dataSize; + size += 1 * getIpBlocksList().size(); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source other = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) obj; + + if (!getPrincipalsList().equals(other.getPrincipalsList())) return false; + if (!getIpBlocksList().equals(other.getIpBlocksList())) 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 (getPrincipalsCount() > 0) { + hash = (37 * hash) + PRINCIPALS_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalsList().hashCode(); + } + if (getIpBlocksCount() > 0) { + hash = (37 * hash) + IP_BLOCKS_FIELD_NUMBER; + hash = (53 * hash) + getIpBlocksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source 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; + } + /** + * + * + *
+       * Specification of traffic source attributes.
+       * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + .class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.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(); + principals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + ipBlocks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source build() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source buildPartial() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source result = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + principals_ = principals_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.principals_ = principals_; + if (((bitField0_ & 0x00000002) != 0)) { + ipBlocks_ = ipBlocks_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ipBlocks_ = ipBlocks_; + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source other) { + if (other + == com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + .getDefaultInstance()) return this; + if (!other.principals_.isEmpty()) { + if (principals_.isEmpty()) { + principals_ = other.principals_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePrincipalsIsMutable(); + principals_.addAll(other.principals_); + } + onChanged(); + } + if (!other.ipBlocks_.isEmpty()) { + if (ipBlocks_.isEmpty()) { + ipBlocks_ = other.ipBlocks_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIpBlocksIsMutable(); + ipBlocks_.addAll(other.ipBlocks_); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList principals_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePrincipalsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + principals_ = new com.google.protobuf.LazyStringArrayList(principals_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the principals. + */ + public com.google.protobuf.ProtocolStringList getPrincipalsList() { + return principals_.getUnmodifiableView(); + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of principals. + */ + public int getPrincipalsCount() { + return principals_.size(); + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The principals at the given index. + */ + public java.lang.String getPrincipals(int index) { + return principals_.get(index); + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the principals at the given index. + */ + public com.google.protobuf.ByteString getPrincipalsBytes(int index) { + return principals_.getByteString(index); + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The principals to set. + * @return This builder for chaining. + */ + public Builder setPrincipals(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalsIsMutable(); + principals_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The principals to add. + * @return This builder for chaining. + */ + public Builder addPrincipals(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalsIsMutable(); + principals_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The principals to add. + * @return This builder for chaining. + */ + public Builder addAllPrincipals(java.lang.Iterable values) { + ensurePrincipalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, principals_); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrincipals() { + principals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of peer identities to match for authorization. At least one
+         * principal should match. Each peer can be an exact match, or a prefix
+         * match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
+         * ServerTlsPolicy resource) is considered insecure.
+         * 
+ * + * repeated string principals = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the principals to add. + * @return This builder for chaining. + */ + public Builder addPrincipalsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePrincipalsIsMutable(); + principals_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ipBlocks_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIpBlocksIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ipBlocks_ = new com.google.protobuf.LazyStringArrayList(ipBlocks_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the ipBlocks. + */ + public com.google.protobuf.ProtocolStringList getIpBlocksList() { + return ipBlocks_.getUnmodifiableView(); + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of ipBlocks. + */ + public int getIpBlocksCount() { + return ipBlocks_.size(); + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The ipBlocks at the given index. + */ + public java.lang.String getIpBlocks(int index) { + return ipBlocks_.get(index); + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the ipBlocks at the given index. + */ + public com.google.protobuf.ByteString getIpBlocksBytes(int index) { + return ipBlocks_.getByteString(index); + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The ipBlocks to set. + * @return This builder for chaining. + */ + public Builder setIpBlocks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpBlocksIsMutable(); + ipBlocks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ipBlocks to add. + * @return This builder for chaining. + */ + public Builder addIpBlocks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIpBlocksIsMutable(); + ipBlocks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The ipBlocks to add. + * @return This builder for chaining. + */ + public Builder addAllIpBlocks(java.lang.Iterable values) { + ensureIpBlocksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipBlocks_); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIpBlocks() { + ipBlocks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. List of CIDR ranges to match based on source IP address. At least one
+         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
+         * "1.2.3.0/24") are supported. Authorization based on source IP alone
+         * should be avoided. The IP addresses of any load balancers or proxies
+         * should be considered untrusted.
+         * 
+ * + * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the ipBlocks to add. + * @return This builder for chaining. + */ + public Builder addIpBlocksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIpBlocksIsMutable(); + ipBlocks_.add(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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source) + private static final com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source(); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the hosts. + */ + java.util.List getHostsList(); + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of hosts. + */ + int getHostsCount(); + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The hosts at the given index. + */ + java.lang.String getHosts(int index); + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the hosts at the given index. + */ + com.google.protobuf.ByteString getHostsBytes(int index); + + /** + * + * + *
+       * Required. List of destination ports to match. At least one port should match.
+       * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ports. + */ + java.util.List getPortsList(); + /** + * + * + *
+       * Required. List of destination ports to match. At least one port should match.
+       * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ports. + */ + int getPortsCount(); + /** + * + * + *
+       * Required. List of destination ports to match. At least one port should match.
+       * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ports at the given index. + */ + int getPorts(int index); + + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the methods. + */ + java.util.List getMethodsList(); + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of methods. + */ + int getMethodsCount(); + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The methods at the given index. + */ + java.lang.String getMethods(int index); + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the methods at the given index. + */ + com.google.protobuf.ByteString getMethodsBytes(int index); + + /** + * + * + *
+       * Optional. Match against key:value pair in http header. Provides a flexible match
+       * based on HTTP headers, for potentially advanced use cases. At least one
+       * header should match. Avoid using header matches to make authorization
+       * decisions unless there is a strong guarantee that requests arrive
+       * through a trusted client or proxy.
+       * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the httpHeaderMatch field is set. + */ + boolean hasHttpHeaderMatch(); + /** + * + * + *
+       * Optional. Match against key:value pair in http header. Provides a flexible match
+       * based on HTTP headers, for potentially advanced use cases. At least one
+       * header should match. Avoid using header matches to make authorization
+       * decisions unless there is a strong guarantee that requests arrive
+       * through a trusted client or proxy.
+       * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The httpHeaderMatch. + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + getHttpHeaderMatch(); + /** + * + * + *
+       * Optional. Match against key:value pair in http header. Provides a flexible match
+       * based on HTTP headers, for potentially advanced use cases. At least one
+       * header should match. Avoid using header matches to make authorization
+       * decisions unless there is a strong guarantee that requests arrive
+       * through a trusted client or proxy.
+       * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder + getHttpHeaderMatchOrBuilder(); + } + /** + * + * + *
+     * Specification of traffic destination attributes.
+     * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination} + */ + public static final class Destination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) + DestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Destination.newBuilder() to construct. + private Destination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Destination() { + hosts_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ports_ = emptyIntList(); + methods_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Destination(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Destination( + 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)) { + hosts_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + hosts_.add(s); + break; + } + case 16: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ports_ = newIntList(); + mutable_bitField0_ |= 0x00000002; + } + ports_.addInt(input.readUInt32()); + break; + } + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { + ports_ = newIntList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + ports_.addInt(input.readUInt32()); + } + input.popLimit(limit); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + methods_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + methods_.add(s); + break; + } + case 42: + { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder + subBuilder = null; + if (httpHeaderMatch_ != null) { + subBuilder = httpHeaderMatch_.toBuilder(); + } + httpHeaderMatch_ = + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(httpHeaderMatch_); + httpHeaderMatch_ = 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)) { + hosts_ = hosts_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ports_.makeImmutable(); // C + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + methods_ = methods_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + .class); + } + + public interface HttpHeaderMatchOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Required. The value of the header must match the regular expression
+         * specified in regexMatch. For regular expression grammar,
+         * please see: en.cppreference.com/w/cpp/regex/ecmascript
+         * For matching against a port specified in the HTTP
+         * request, use a headerMatch with headerName set to Host
+         * and a regular expression that satisfies the RFC2616 Host
+         * header's port specifier.
+         * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the regexMatch field is set. + */ + boolean hasRegexMatch(); + /** + * + * + *
+         * Required. The value of the header must match the regular expression
+         * specified in regexMatch. For regular expression grammar,
+         * please see: en.cppreference.com/w/cpp/regex/ecmascript
+         * For matching against a port specified in the HTTP
+         * request, use a headerMatch with headerName set to Host
+         * and a regular expression that satisfies the RFC2616 Host
+         * header's port specifier.
+         * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The regexMatch. + */ + java.lang.String getRegexMatch(); + /** + * + * + *
+         * Required. The value of the header must match the regular expression
+         * specified in regexMatch. For regular expression grammar,
+         * please see: en.cppreference.com/w/cpp/regex/ecmascript
+         * For matching against a port specified in the HTTP
+         * request, use a headerMatch with headerName set to Host
+         * and a regular expression that satisfies the RFC2616 Host
+         * header's port specifier.
+         * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for regexMatch. + */ + com.google.protobuf.ByteString getRegexMatchBytes(); + + /** + * + * + *
+         * Required. The name of the HTTP header to match. For matching
+         * against the HTTP request's authority, use a headerMatch
+         * with the header name ":authority". For matching a
+         * request's method, use the headerName ":method".
+         * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The headerName. + */ + java.lang.String getHeaderName(); + /** + * + * + *
+         * Required. The name of the HTTP header to match. For matching
+         * against the HTTP request's authority, use a headerMatch
+         * with the header name ":authority". For matching a
+         * request's method, use the headerName ":method".
+         * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for headerName. + */ + com.google.protobuf.ByteString getHeaderNameBytes(); + + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.TypeCase + getTypeCase(); + } + /** + * + * + *
+       * Specification of HTTP header match attributes.
+       * 
+ * + * Protobuf type {@code + * google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch} + */ + public static final class HttpHeaderMatch extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch) + HttpHeaderMatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use HttpHeaderMatch.newBuilder() to construct. + private HttpHeaderMatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HttpHeaderMatch() { + headerName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HttpHeaderMatch(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HttpHeaderMatch( + 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(); + + headerName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + typeCase_ = 2; + type_ = 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public enum TypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + REGEX_MATCH(2), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(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 TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 2: + return REGEX_MATCH; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int REGEX_MATCH_FIELD_NUMBER = 2; + /** + * + * + *
+         * Required. The value of the header must match the regular expression
+         * specified in regexMatch. For regular expression grammar,
+         * please see: en.cppreference.com/w/cpp/regex/ecmascript
+         * For matching against a port specified in the HTTP
+         * request, use a headerMatch with headerName set to Host
+         * and a regular expression that satisfies the RFC2616 Host
+         * header's port specifier.
+         * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the regexMatch field is set. + */ + public boolean hasRegexMatch() { + return typeCase_ == 2; + } + /** + * + * + *
+         * Required. The value of the header must match the regular expression
+         * specified in regexMatch. For regular expression grammar,
+         * please see: en.cppreference.com/w/cpp/regex/ecmascript
+         * For matching against a port specified in the HTTP
+         * request, use a headerMatch with headerName set to Host
+         * and a regular expression that satisfies the RFC2616 Host
+         * header's port specifier.
+         * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The regexMatch. + */ + public java.lang.String getRegexMatch() { + java.lang.Object ref = ""; + if (typeCase_ == 2) { + ref = type_; + } + 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(); + if (typeCase_ == 2) { + type_ = s; + } + return s; + } + } + /** + * + * + *
+         * Required. The value of the header must match the regular expression
+         * specified in regexMatch. For regular expression grammar,
+         * please see: en.cppreference.com/w/cpp/regex/ecmascript
+         * For matching against a port specified in the HTTP
+         * request, use a headerMatch with headerName set to Host
+         * and a regular expression that satisfies the RFC2616 Host
+         * header's port specifier.
+         * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for regexMatch. + */ + public com.google.protobuf.ByteString getRegexMatchBytes() { + java.lang.Object ref = ""; + if (typeCase_ == 2) { + ref = type_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (typeCase_ == 2) { + type_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADER_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object headerName_; + /** + * + * + *
+         * Required. The name of the HTTP header to match. For matching
+         * against the HTTP request's authority, use a headerMatch
+         * with the header name ":authority". For matching a
+         * request's method, use the headerName ":method".
+         * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The headerName. + */ + @java.lang.Override + public java.lang.String getHeaderName() { + java.lang.Object ref = headerName_; + 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(); + headerName_ = s; + return s; + } + } + /** + * + * + *
+         * Required. The name of the HTTP header to match. For matching
+         * against the HTTP request's authority, use a headerMatch
+         * with the header name ":authority". For matching a
+         * request's method, use the headerName ":method".
+         * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for headerName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeaderNameBytes() { + java.lang.Object ref = headerName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headerName_ = 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(headerName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, headerName_); + } + if (typeCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + 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(headerName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, headerName_); + } + if (typeCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + other = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch) + obj; + + if (!getHeaderName().equals(other.getHeaderName())) return false; + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 2: + if (!getRegexMatch().equals(other.getRegexMatch())) 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) + HEADER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getHeaderName().hashCode(); + switch (typeCase_) { + case 2: + hash = (37 * hash) + REGEX_MATCH_FIELD_NUMBER; + hash = (53 * hash) + getRegexMatch().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + 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; + } + /** + * + * + *
+         * Specification of HTTP header match attributes.
+         * 
+ * + * Protobuf type {@code + * google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch) + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch.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(); + headerName_ = ""; + + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + build() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + buildPartial() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + result = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch(this); + if (typeCase_ == 2) { + result.type_ = type_; + } + result.headerName_ = headerName_; + result.typeCase_ = typeCase_; + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + other) { + if (other + == com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.getDefaultInstance()) return this; + if (!other.getHeaderName().isEmpty()) { + headerName_ = other.headerName_; + onChanged(); + } + switch (other.getTypeCase()) { + case REGEX_MATCH: + { + typeCase_ = 2; + type_ = other.type_; + onChanged(); + break; + } + case TYPE_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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+           * Required. The value of the header must match the regular expression
+           * specified in regexMatch. For regular expression grammar,
+           * please see: en.cppreference.com/w/cpp/regex/ecmascript
+           * For matching against a port specified in the HTTP
+           * request, use a headerMatch with headerName set to Host
+           * and a regular expression that satisfies the RFC2616 Host
+           * header's port specifier.
+           * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the regexMatch field is set. + */ + @java.lang.Override + public boolean hasRegexMatch() { + return typeCase_ == 2; + } + /** + * + * + *
+           * Required. The value of the header must match the regular expression
+           * specified in regexMatch. For regular expression grammar,
+           * please see: en.cppreference.com/w/cpp/regex/ecmascript
+           * For matching against a port specified in the HTTP
+           * request, use a headerMatch with headerName set to Host
+           * and a regular expression that satisfies the RFC2616 Host
+           * header's port specifier.
+           * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The regexMatch. + */ + @java.lang.Override + public java.lang.String getRegexMatch() { + java.lang.Object ref = ""; + if (typeCase_ == 2) { + ref = type_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (typeCase_ == 2) { + type_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+           * Required. The value of the header must match the regular expression
+           * specified in regexMatch. For regular expression grammar,
+           * please see: en.cppreference.com/w/cpp/regex/ecmascript
+           * For matching against a port specified in the HTTP
+           * request, use a headerMatch with headerName set to Host
+           * and a regular expression that satisfies the RFC2616 Host
+           * header's port specifier.
+           * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for regexMatch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegexMatchBytes() { + java.lang.Object ref = ""; + if (typeCase_ == 2) { + ref = type_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (typeCase_ == 2) { + type_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+           * Required. The value of the header must match the regular expression
+           * specified in regexMatch. For regular expression grammar,
+           * please see: en.cppreference.com/w/cpp/regex/ecmascript
+           * For matching against a port specified in the HTTP
+           * request, use a headerMatch with headerName set to Host
+           * and a regular expression that satisfies the RFC2616 Host
+           * header's port specifier.
+           * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The regexMatch to set. + * @return This builder for chaining. + */ + public Builder setRegexMatch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + typeCase_ = 2; + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The value of the header must match the regular expression
+           * specified in regexMatch. For regular expression grammar,
+           * please see: en.cppreference.com/w/cpp/regex/ecmascript
+           * For matching against a port specified in the HTTP
+           * request, use a headerMatch with headerName set to Host
+           * and a regular expression that satisfies the RFC2616 Host
+           * header's port specifier.
+           * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRegexMatch() { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+           * Required. The value of the header must match the regular expression
+           * specified in regexMatch. For regular expression grammar,
+           * please see: en.cppreference.com/w/cpp/regex/ecmascript
+           * For matching against a port specified in the HTTP
+           * request, use a headerMatch with headerName set to Host
+           * and a regular expression that satisfies the RFC2616 Host
+           * header's port specifier.
+           * 
+ * + * string regex_match = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for regexMatch to set. + * @return This builder for chaining. + */ + public Builder setRegexMatchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + typeCase_ = 2; + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object headerName_ = ""; + /** + * + * + *
+           * Required. The name of the HTTP header to match. For matching
+           * against the HTTP request's authority, use a headerMatch
+           * with the header name ":authority". For matching a
+           * request's method, use the headerName ":method".
+           * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The headerName. + */ + public java.lang.String getHeaderName() { + java.lang.Object ref = headerName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + headerName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+           * Required. The name of the HTTP header to match. For matching
+           * against the HTTP request's authority, use a headerMatch
+           * with the header name ":authority". For matching a
+           * request's method, use the headerName ":method".
+           * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for headerName. + */ + public com.google.protobuf.ByteString getHeaderNameBytes() { + java.lang.Object ref = headerName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headerName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+           * Required. The name of the HTTP header to match. For matching
+           * against the HTTP request's authority, use a headerMatch
+           * with the header name ":authority". For matching a
+           * request's method, use the headerName ":method".
+           * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The headerName to set. + * @return This builder for chaining. + */ + public Builder setHeaderName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + headerName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The name of the HTTP header to match. For matching
+           * against the HTTP request's authority, use a headerMatch
+           * with the header name ":authority". For matching a
+           * request's method, use the headerName ":method".
+           * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearHeaderName() { + + headerName_ = getDefaultInstance().getHeaderName(); + onChanged(); + return this; + } + /** + * + * + *
+           * Required. The name of the HTTP header to match. For matching
+           * against the HTTP request's authority, use a headerMatch
+           * with the header name ":authority". For matching a
+           * request's method, use the headerName ":method".
+           * 
+ * + * string header_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for headerName to set. + * @return This builder for chaining. + */ + public Builder setHeaderNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + headerName_ = 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch) + private static final com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule + .Destination.HttpHeaderMatch + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch(); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpHeaderMatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpHeaderMatch(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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int HOSTS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList hosts_; + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the hosts. + */ + public com.google.protobuf.ProtocolStringList getHostsList() { + return hosts_; + } + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of hosts. + */ + public int getHostsCount() { + return hosts_.size(); + } + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The hosts at the given index. + */ + public java.lang.String getHosts(int index) { + return hosts_.get(index); + } + /** + * + * + *
+       * Required. List of host names to match. Matched against the ":authority" header in
+       * http requests. At least one host should match. Each host can be an
+       * exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
+       * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the hosts at the given index. + */ + public com.google.protobuf.ByteString getHostsBytes(int index) { + return hosts_.getByteString(index); + } + + public static final int PORTS_FIELD_NUMBER = 2; + private com.google.protobuf.Internal.IntList ports_; + /** + * + * + *
+       * Required. List of destination ports to match. At least one port should match.
+       * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ports. + */ + @java.lang.Override + public java.util.List getPortsList() { + return ports_; + } + /** + * + * + *
+       * Required. List of destination ports to match. At least one port should match.
+       * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ports. + */ + public int getPortsCount() { + return ports_.size(); + } + /** + * + * + *
+       * Required. List of destination ports to match. At least one port should match.
+       * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ports at the given index. + */ + public int getPorts(int index) { + return ports_.getInt(index); + } + + private int portsMemoizedSerializedSize = -1; + + public static final int METHODS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList methods_; + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the methods. + */ + public com.google.protobuf.ProtocolStringList getMethodsList() { + return methods_; + } + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of methods. + */ + public int getMethodsCount() { + return methods_.size(); + } + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The methods at the given index. + */ + public java.lang.String getMethods(int index) { + return methods_.get(index); + } + /** + * + * + *
+       * Optional. A list of HTTP methods to match. At least one method should
+       * match. Should not be set for gRPC services.
+       * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the methods at the given index. + */ + public com.google.protobuf.ByteString getMethodsBytes(int index) { + return methods_.getByteString(index); + } + + public static final int HTTP_HEADER_MATCH_FIELD_NUMBER = 5; + private com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + httpHeaderMatch_; + /** + * + * + *
+       * Optional. Match against key:value pair in http header. Provides a flexible match
+       * based on HTTP headers, for potentially advanced use cases. At least one
+       * header should match. Avoid using header matches to make authorization
+       * decisions unless there is a strong guarantee that requests arrive
+       * through a trusted client or proxy.
+       * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the httpHeaderMatch field is set. + */ + @java.lang.Override + public boolean hasHttpHeaderMatch() { + return httpHeaderMatch_ != null; + } + /** + * + * + *
+       * Optional. Match against key:value pair in http header. Provides a flexible match
+       * based on HTTP headers, for potentially advanced use cases. At least one
+       * header should match. Avoid using header matches to make authorization
+       * decisions unless there is a strong guarantee that requests arrive
+       * through a trusted client or proxy.
+       * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The httpHeaderMatch. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + getHttpHeaderMatch() { + return httpHeaderMatch_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.getDefaultInstance() + : httpHeaderMatch_; + } + /** + * + * + *
+       * Optional. Match against key:value pair in http header. Provides a flexible match
+       * based on HTTP headers, for potentially advanced use cases. At least one
+       * header should match. Avoid using header matches to make authorization
+       * decisions unless there is a strong guarantee that requests arrive
+       * through a trusted client or proxy.
+       * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder + getHttpHeaderMatchOrBuilder() { + return getHttpHeaderMatch(); + } + + 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 { + getSerializedSize(); + for (int i = 0; i < hosts_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hosts_.getRaw(i)); + } + if (getPortsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(portsMemoizedSerializedSize); + } + for (int i = 0; i < ports_.size(); i++) { + output.writeUInt32NoTag(ports_.getInt(i)); + } + for (int i = 0; i < methods_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, methods_.getRaw(i)); + } + if (httpHeaderMatch_ != null) { + output.writeMessage(5, getHttpHeaderMatch()); + } + 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 < hosts_.size(); i++) { + dataSize += computeStringSizeNoTag(hosts_.getRaw(i)); + } + size += dataSize; + size += 1 * getHostsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < ports_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(ports_.getInt(i)); + } + size += dataSize; + if (!getPortsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + portsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < methods_.size(); i++) { + dataSize += computeStringSizeNoTag(methods_.getRaw(i)); + } + size += dataSize; + size += 1 * getMethodsList().size(); + } + if (httpHeaderMatch_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getHttpHeaderMatch()); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination other = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) obj; + + if (!getHostsList().equals(other.getHostsList())) return false; + if (!getPortsList().equals(other.getPortsList())) return false; + if (!getMethodsList().equals(other.getMethodsList())) return false; + if (hasHttpHeaderMatch() != other.hasHttpHeaderMatch()) return false; + if (hasHttpHeaderMatch()) { + if (!getHttpHeaderMatch().equals(other.getHttpHeaderMatch())) 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 (getHostsCount() > 0) { + hash = (37 * hash) + HOSTS_FIELD_NUMBER; + hash = (53 * hash) + getHostsList().hashCode(); + } + if (getPortsCount() > 0) { + hash = (37 * hash) + PORTS_FIELD_NUMBER; + hash = (53 * hash) + getPortsList().hashCode(); + } + if (getMethodsCount() > 0) { + hash = (37 * hash) + METHODS_FIELD_NUMBER; + hash = (53 * hash) + getMethodsList().hashCode(); + } + if (hasHttpHeaderMatch()) { + hash = (37 * hash) + HTTP_HEADER_MATCH_FIELD_NUMBER; + hash = (53 * hash) + getHttpHeaderMatch().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination 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; + } + /** + * + * + *
+       * Specification of traffic destination attributes.
+       * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + .class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.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(); + hosts_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + ports_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + methods_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (httpHeaderMatchBuilder_ == null) { + httpHeaderMatch_ = null; + } else { + httpHeaderMatch_ = null; + httpHeaderMatchBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination build() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + buildPartial() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination result = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + hosts_ = hosts_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.hosts_ = hosts_; + if (((bitField0_ & 0x00000002) != 0)) { + ports_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ports_ = ports_; + if (((bitField0_ & 0x00000004) != 0)) { + methods_ = methods_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.methods_ = methods_; + if (httpHeaderMatchBuilder_ == null) { + result.httpHeaderMatch_ = httpHeaderMatch_; + } else { + result.httpHeaderMatch_ = httpHeaderMatchBuilder_.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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination other) { + if (other + == com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .getDefaultInstance()) return this; + if (!other.hosts_.isEmpty()) { + if (hosts_.isEmpty()) { + hosts_ = other.hosts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHostsIsMutable(); + hosts_.addAll(other.hosts_); + } + onChanged(); + } + if (!other.ports_.isEmpty()) { + if (ports_.isEmpty()) { + ports_ = other.ports_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePortsIsMutable(); + ports_.addAll(other.ports_); + } + onChanged(); + } + if (!other.methods_.isEmpty()) { + if (methods_.isEmpty()) { + methods_ = other.methods_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureMethodsIsMutable(); + methods_.addAll(other.methods_); + } + onChanged(); + } + if (other.hasHttpHeaderMatch()) { + mergeHttpHeaderMatch(other.getHttpHeaderMatch()); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList hosts_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureHostsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + hosts_ = new com.google.protobuf.LazyStringArrayList(hosts_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the hosts. + */ + public com.google.protobuf.ProtocolStringList getHostsList() { + return hosts_.getUnmodifiableView(); + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of hosts. + */ + public int getHostsCount() { + return hosts_.size(); + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The hosts at the given index. + */ + public java.lang.String getHosts(int index) { + return hosts_.get(index); + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the hosts at the given index. + */ + public com.google.protobuf.ByteString getHostsBytes(int index) { + return hosts_.getByteString(index); + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The hosts to set. + * @return This builder for chaining. + */ + public Builder setHosts(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostsIsMutable(); + hosts_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The hosts to add. + * @return This builder for chaining. + */ + public Builder addHosts(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostsIsMutable(); + hosts_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The hosts to add. + * @return This builder for chaining. + */ + public Builder addAllHosts(java.lang.Iterable values) { + ensureHostsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hosts_); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearHosts() { + hosts_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of host names to match. Matched against the ":authority" header in
+         * http requests. At least one host should match. Each host can be an
+         * exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
+         * 
+ * + * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the hosts to add. + * @return This builder for chaining. + */ + public Builder addHostsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureHostsIsMutable(); + hosts_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList ports_ = emptyIntList(); + + private void ensurePortsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ports_ = mutableCopy(ports_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ports. + */ + public java.util.List getPortsList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(ports_) + : ports_; + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ports. + */ + public int getPortsCount() { + return ports_.size(); + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ports at the given index. + */ + public int getPorts(int index) { + return ports_.getInt(index); + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The ports to set. + * @return This builder for chaining. + */ + public Builder setPorts(int index, int value) { + ensurePortsIsMutable(); + ports_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The ports to add. + * @return This builder for chaining. + */ + public Builder addPorts(int value) { + ensurePortsIsMutable(); + ports_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The ports to add. + * @return This builder for chaining. + */ + public Builder addAllPorts(java.lang.Iterable values) { + ensurePortsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ports_); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. List of destination ports to match. At least one port should match.
+         * 
+ * + * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPorts() { + ports_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList methods_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMethodsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + methods_ = new com.google.protobuf.LazyStringArrayList(methods_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the methods. + */ + public com.google.protobuf.ProtocolStringList getMethodsList() { + return methods_.getUnmodifiableView(); + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of methods. + */ + public int getMethodsCount() { + return methods_.size(); + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The methods at the given index. + */ + public java.lang.String getMethods(int index) { + return methods_.get(index); + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the methods at the given index. + */ + public com.google.protobuf.ByteString getMethodsBytes(int index) { + return methods_.getByteString(index); + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The methods to set. + * @return This builder for chaining. + */ + public Builder setMethods(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodsIsMutable(); + methods_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The methods to add. + * @return This builder for chaining. + */ + public Builder addMethods(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodsIsMutable(); + methods_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The methods to add. + * @return This builder for chaining. + */ + public Builder addAllMethods(java.lang.Iterable values) { + ensureMethodsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, methods_); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearMethods() { + methods_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. A list of HTTP methods to match. At least one method should
+         * match. Should not be set for gRPC services.
+         * 
+ * + * repeated string methods = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the methods to add. + * @return This builder for chaining. + */ + public Builder addMethodsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMethodsIsMutable(); + methods_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + httpHeaderMatch_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder> + httpHeaderMatchBuilder_; + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the httpHeaderMatch field is set. + */ + public boolean hasHttpHeaderMatch() { + return httpHeaderMatchBuilder_ != null || httpHeaderMatch_ != null; + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The httpHeaderMatch. + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch + getHttpHeaderMatch() { + if (httpHeaderMatchBuilder_ == null) { + return httpHeaderMatch_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.getDefaultInstance() + : httpHeaderMatch_; + } else { + return httpHeaderMatchBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setHttpHeaderMatch( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + value) { + if (httpHeaderMatchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + httpHeaderMatch_ = value; + onChanged(); + } else { + httpHeaderMatchBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setHttpHeaderMatch( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + .Builder + builderForValue) { + if (httpHeaderMatchBuilder_ == null) { + httpHeaderMatch_ = builderForValue.build(); + onChanged(); + } else { + httpHeaderMatchBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeHttpHeaderMatch( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch + value) { + if (httpHeaderMatchBuilder_ == null) { + if (httpHeaderMatch_ != null) { + httpHeaderMatch_ = + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.newBuilder(httpHeaderMatch_) + .mergeFrom(value) + .buildPartial(); + } else { + httpHeaderMatch_ = value; + } + onChanged(); + } else { + httpHeaderMatchBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearHttpHeaderMatch() { + if (httpHeaderMatchBuilder_ == null) { + httpHeaderMatch_ = null; + onChanged(); + } else { + httpHeaderMatch_ = null; + httpHeaderMatchBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder + getHttpHeaderMatchBuilder() { + + onChanged(); + return getHttpHeaderMatchFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder + getHttpHeaderMatchOrBuilder() { + if (httpHeaderMatchBuilder_ != null) { + return httpHeaderMatchBuilder_.getMessageOrBuilder(); + } else { + return httpHeaderMatch_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.getDefaultInstance() + : httpHeaderMatch_; + } + } + /** + * + * + *
+         * Optional. Match against key:value pair in http header. Provides a flexible match
+         * based on HTTP headers, for potentially advanced use cases. At least one
+         * header should match. Avoid using header matches to make authorization
+         * decisions unless there is a strong guarantee that requests arrive
+         * through a trusted client or proxy.
+         * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch http_header_match = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder> + getHttpHeaderMatchFieldBuilder() { + if (httpHeaderMatchBuilder_ == null) { + httpHeaderMatchBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatch.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .HttpHeaderMatchOrBuilder>( + getHttpHeaderMatch(), getParentForChildren(), isClean()); + httpHeaderMatch_ = null; + } + return httpHeaderMatchBuilder_; + } + + @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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination) + private static final com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination(); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Destination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Destination(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.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SOURCES_FIELD_NUMBER = 1; + private java.util.List + sources_; + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSourcesList() { + return sources_; + } + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder> + getSourcesOrBuilderList() { + return sources_; + } + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSourcesCount() { + return sources_.size(); + } + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source getSources( + int index) { + return sources_.get(index); + } + /** + * + * + *
+     * Optional. List of attributes for the traffic source. All of the sources must match.
+     * A source is a match if both principals and ip_blocks match. If not set,
+     * the action specified in the 'action' field will be applied without any
+     * rule checks for the source.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder + getSourcesOrBuilder(int index) { + return sources_.get(index); + } + + public static final int DESTINATIONS_FIELD_NUMBER = 2; + private java.util.List + destinations_; + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getDestinationsList() { + return destinations_; + } + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder> + getDestinationsOrBuilderList() { + return destinations_; + } + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getDestinationsCount() { + return destinations_.size(); + } + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination getDestinations( + int index) { + return destinations_.get(index); + } + /** + * + * + *
+     * Optional. List of attributes for the traffic destination. All of the destinations
+     * must match. A destination is a match if a request matches all the
+     * specified hosts, ports, methods and headers. If not set, the
+     * action specified in the 'action' field will be applied without any rule
+     * checks for the destination.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder + getDestinationsOrBuilder(int index) { + return destinations_.get(index); + } + + 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 < sources_.size(); i++) { + output.writeMessage(1, sources_.get(i)); + } + for (int i = 0; i < destinations_.size(); i++) { + output.writeMessage(2, destinations_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sources_.get(i)); + } + for (int i = 0; i < destinations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, destinations_.get(i)); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule other = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) obj; + + if (!getSourcesList().equals(other.getSourcesList())) return false; + if (!getDestinationsList().equals(other.getDestinationsList())) 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 (getSourcesCount() > 0) { + hash = (37 * hash) + SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getSourcesList().hashCode(); + } + if (getDestinationsCount() > 0) { + hash = (37 * hash) + DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDestinationsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule 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; + } + /** + * + * + *
+     * Specification of rules.
+     * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy.Rule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) + com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSourcesFieldBuilder(); + getDestinationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sourcesBuilder_ == null) { + sources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sourcesBuilder_.clear(); + } + if (destinationsBuilder_ == null) { + destinations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + destinationsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule build() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule buildPartial() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule result = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule(this); + int from_bitField0_ = bitField0_; + if (sourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sources_ = java.util.Collections.unmodifiableList(sources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sources_ = sources_; + } else { + result.sources_ = sourcesBuilder_.build(); + } + if (destinationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + destinations_ = java.util.Collections.unmodifiableList(destinations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.destinations_ = destinations_; + } else { + result.destinations_ = destinationsBuilder_.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.cloud.networksecurity.v1.AuthorizationPolicy.Rule) { + return mergeFrom((com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule other) { + if (other + == com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.getDefaultInstance()) + return this; + if (sourcesBuilder_ == null) { + if (!other.sources_.isEmpty()) { + if (sources_.isEmpty()) { + sources_ = other.sources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSourcesIsMutable(); + sources_.addAll(other.sources_); + } + onChanged(); + } + } else { + if (!other.sources_.isEmpty()) { + if (sourcesBuilder_.isEmpty()) { + sourcesBuilder_.dispose(); + sourcesBuilder_ = null; + sources_ = other.sources_; + bitField0_ = (bitField0_ & ~0x00000001); + sourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSourcesFieldBuilder() + : null; + } else { + sourcesBuilder_.addAllMessages(other.sources_); + } + } + } + if (destinationsBuilder_ == null) { + if (!other.destinations_.isEmpty()) { + if (destinations_.isEmpty()) { + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDestinationsIsMutable(); + destinations_.addAll(other.destinations_); + } + onChanged(); + } + } else { + if (!other.destinations_.isEmpty()) { + if (destinationsBuilder_.isEmpty()) { + destinationsBuilder_.dispose(); + destinationsBuilder_ = null; + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000002); + destinationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDestinationsFieldBuilder() + : null; + } else { + destinationsBuilder_.addAllMessages(other.destinations_); + } + } + } + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + sources_ = java.util.Collections.emptyList(); + + private void ensureSourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sources_ = + new java.util.ArrayList< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source>(sources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder> + sourcesBuilder_; + + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSourcesList() { + if (sourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(sources_); + } else { + return sourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSourcesCount() { + if (sourcesBuilder_ == null) { + return sources_.size(); + } else { + return sourcesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source getSources( + int index) { + if (sourcesBuilder_ == null) { + return sources_.get(index); + } else { + return sourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSources( + int index, com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.set(index, value); + onChanged(); + } else { + sourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSources( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.set(index, builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSources( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.add(value); + onChanged(); + } else { + sourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSources( + int index, com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.add(index, value); + onChanged(); + } else { + sourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSources( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.add(builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSources( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.add(index, builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSources( + java.lang.Iterable< + ? extends com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source> + values) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sources_); + onChanged(); + } else { + sourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSources() { + if (sourcesBuilder_ == null) { + sources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSources(int index) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.remove(index); + onChanged(); + } else { + sourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + getSourcesBuilder(int index) { + return getSourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder + getSourcesOrBuilder(int index) { + if (sourcesBuilder_ == null) { + return sources_.get(index); + } else { + return sourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder> + getSourcesOrBuilderList() { + if (sourcesBuilder_ != null) { + return sourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sources_); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + addSourcesBuilder() { + return getSourcesFieldBuilder() + .addBuilder( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder + addSourcesBuilder(int index) { + return getSourcesFieldBuilder() + .addBuilder( + index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional. List of attributes for the traffic source. All of the sources must match.
+       * A source is a match if both principals and ip_blocks match. If not set,
+       * the action specified in the 'action' field will be applied without any
+       * rule checks for the source.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source sources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder> + getSourcesBuilderList() { + return getSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder> + getSourcesFieldBuilder() { + if (sourcesBuilder_ == null) { + sourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.SourceOrBuilder>( + sources_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sources_ = null; + } + return sourcesBuilder_; + } + + private java.util.List< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination> + destinations_ = java.util.Collections.emptyList(); + + private void ensureDestinationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + destinations_ = + new java.util.ArrayList< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination>( + destinations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder> + destinationsBuilder_; + + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination> + getDestinationsList() { + if (destinationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(destinations_); + } else { + return destinationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getDestinationsCount() { + if (destinationsBuilder_ == null) { + return destinations_.size(); + } else { + return destinationsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + getDestinations(int index) { + if (destinationsBuilder_ == null) { + return destinations_.get(index); + } else { + return destinationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDestinations( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.set(index, value); + onChanged(); + } else { + destinationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDestinations( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.set(index, builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + } else { + destinationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(index, value); + onChanged(); + } else { + destinationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(index, builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllDestinations( + java.lang.Iterable< + ? extends + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination> + values) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, destinations_); + onChanged(); + } else { + destinationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDestinations() { + if (destinationsBuilder_ == null) { + destinations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + destinationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeDestinations(int index) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.remove(index); + onChanged(); + } else { + destinationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + getDestinationsBuilder(int index) { + return getDestinationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder + getDestinationsOrBuilder(int index) { + if (destinationsBuilder_ == null) { + return destinations_.get(index); + } else { + return destinationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder> + getDestinationsOrBuilderList() { + if (destinationsBuilder_ != null) { + return destinationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(destinations_); + } + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + addDestinationsBuilder() { + return getDestinationsFieldBuilder() + .addBuilder( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder + addDestinationsBuilder(int index) { + return getDestinationsFieldBuilder() + .addBuilder( + index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional. List of attributes for the traffic destination. All of the destinations
+       * must match. A destination is a match if a request matches all the
+       * specified hosts, ports, methods and headers. If not set, the
+       * action specified in the 'action' field will be applied without any rule
+       * checks for the destination.
+       * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination destinations = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder> + getDestinationsBuilderList() { + return getDestinationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.DestinationOrBuilder> + getDestinationsFieldBuilder() { + if (destinationsBuilder_ == null) { + destinationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule + .DestinationOrBuilder>( + destinations_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + destinations_ = null; + } + return destinationsBuilder_; + } + + @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.cloud.networksecurity.v1.AuthorizationPolicy.Rule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.AuthorizationPolicy.Rule) + private static final com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule(); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rule(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.cloud.networksecurity.v1.AuthorizationPolicy.Rule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the AuthorizationPolicy resource. It matches pattern
+   * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+   * 
+ * + * 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. Name of the AuthorizationPolicy resource. It matches pattern
+   * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+   * 
+ * + * 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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ACTION_FIELD_NUMBER = 6; + private int action_; + /** + * + * + *
+   * Required. The action to take when a rule match is found. Possible values
+   * are "ALLOW" or "DENY".
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + /** + * + * + *
+   * Required. The action to take when a rule match is found. Possible values
+   * are "ALLOW" or "DENY".
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The action. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action getAction() { + @SuppressWarnings("deprecation") + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action result = + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action.valueOf(action_); + return result == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action.UNRECOGNIZED + : result; + } + + public static final int RULES_FIELD_NUMBER = 7; + private java.util.List rules_; + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getRulesList() { + return rules_; + } + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder> + getRulesOrBuilderList() { + return rules_; + } + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule getRules(int index) { + return rules_.get(index); + } + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder getRulesOrBuilder( + int index) { + return rules_.get(index); + } + + 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(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (action_ + != com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action.ACTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, action_); + } + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(7, rules_.get(i)); + } + 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(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); + } + if (action_ + != com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action.ACTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, action_); + } + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, rules_.get(i)); + } + 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.cloud.networksecurity.v1.AuthorizationPolicy)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.AuthorizationPolicy other = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) 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 (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (action_ != other.action_) return false; + if (!getRulesList().equals(other.getRulesList())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().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 (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy 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.cloud.networksecurity.v1.AuthorizationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy 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.cloud.networksecurity.v1.AuthorizationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy 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.cloud.networksecurity.v1.AuthorizationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy 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.cloud.networksecurity.v1.AuthorizationPolicy 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; + } + /** + * + * + *
+   * AuthorizationPolicy is a resource that specifies how a server
+   * should authorize incoming connections. This resource in itself does
+   * not change the configuration unless it's attached to a target https
+   * proxy or endpoint config selector resource.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.AuthorizationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.AuthorizationPolicy) + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.class, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.AuthorizationPolicy.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_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + action_ = 0; + + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + rulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy build() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy buildPartial() { + com.google.cloud.networksecurity.v1.AuthorizationPolicy result = + new com.google.cloud.networksecurity.v1.AuthorizationPolicy(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.action_ = action_; + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.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.cloud.networksecurity.v1.AuthorizationPolicy) { + return mergeFrom((com.google.cloud.networksecurity.v1.AuthorizationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.AuthorizationPolicy other) { + if (other == com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + 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_); + } + } + } + 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.cloud.networksecurity.v1.AuthorizationPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.AuthorizationPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the AuthorizationPolicy resource. It matches pattern
+     * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+     * 
+ * + * 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. Name of the AuthorizationPolicy resource. It matches pattern
+     * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+     * 
+ * + * 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. Name of the AuthorizationPolicy resource. It matches pattern
+     * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+     * 
+ * + * 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. Name of the AuthorizationPolicy resource. It matches pattern
+     * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the AuthorizationPolicy resource. It matches pattern
+     * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+     * 
+ * + * 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 description_ = ""; + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + 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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private int action_ = 0; + /** + * + * + *
+     * Required. The action to take when a rule match is found. Possible values
+     * are "ALLOW" or "DENY".
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + /** + * + * + *
+     * Required. The action to take when a rule match is found. Possible values
+     * are "ALLOW" or "DENY".
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The action to take when a rule match is found. Possible values
+     * are "ALLOW" or "DENY".
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The action. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action getAction() { + @SuppressWarnings("deprecation") + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action result = + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action.valueOf(action_); + return result == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The action to take when a rule match is found. Possible values
+     * are "ALLOW" or "DENY".
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The action to take when a rule match is found. Possible values
+     * are "ALLOW" or "DENY".
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = 0; + onChanged(); + return this; + } + + 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.cloud.networksecurity.v1.AuthorizationPolicy.Rule, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRules( + int index, com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRules( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addRules(com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addRules( + int index, com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addRules( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addRules( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder getRulesBuilder( + int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder getRulesOrBuilder( + int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder> + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder addRulesBuilder() { + return getRulesFieldBuilder() + .addBuilder( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder addRulesBuilder( + int index) { + return getRulesFieldBuilder() + .addBuilder( + index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. List of rules to match. Note that at least one of the rules must match in
+     * order for the action specified in the 'action' field to be taken. A rule is
+     * a match if there is a matching source and destination. If left blank, the
+     * action specified in the `action` field will be applied on every request.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder>( + rules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + @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.cloud.networksecurity.v1.AuthorizationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.AuthorizationPolicy) + private static final com.google.cloud.networksecurity.v1.AuthorizationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.AuthorizationPolicy(); + } + + public static com.google.cloud.networksecurity.v1.AuthorizationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AuthorizationPolicy(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.cloud.networksecurity.v1.AuthorizationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyName.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyName.java new file mode 100644 index 00000000..d6af239c --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyName.java @@ -0,0 +1,232 @@ +/* + * 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.cloud.networksecurity.v1; + +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 AuthorizationPolicyName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_AUTHORIZATION_POLICY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String authorizationPolicy; + + @Deprecated + protected AuthorizationPolicyName() { + project = null; + location = null; + authorizationPolicy = null; + } + + private AuthorizationPolicyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + authorizationPolicy = Preconditions.checkNotNull(builder.getAuthorizationPolicy()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAuthorizationPolicy() { + return authorizationPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AuthorizationPolicyName of( + String project, String location, String authorizationPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAuthorizationPolicy(authorizationPolicy) + .build(); + } + + public static String format(String project, String location, String authorizationPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAuthorizationPolicy(authorizationPolicy) + .build() + .toString(); + } + + public static AuthorizationPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_AUTHORIZATION_POLICY.validatedMatch( + formattedString, "AuthorizationPolicyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("authorization_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 (AuthorizationPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_AUTHORIZATION_POLICY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (authorizationPolicy != null) { + fieldMapBuilder.put("authorization_policy", authorizationPolicy); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_AUTHORIZATION_POLICY.instantiate( + "project", project, "location", location, "authorization_policy", authorizationPolicy); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AuthorizationPolicyName that = ((AuthorizationPolicyName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.authorizationPolicy, that.authorizationPolicy); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(authorizationPolicy); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}. + */ + public static class Builder { + private String project; + private String location; + private String authorizationPolicy; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAuthorizationPolicy() { + return authorizationPolicy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAuthorizationPolicy(String authorizationPolicy) { + this.authorizationPolicy = authorizationPolicy; + return this; + } + + private Builder(AuthorizationPolicyName authorizationPolicyName) { + this.project = authorizationPolicyName.project; + this.location = authorizationPolicyName.location; + this.authorizationPolicy = authorizationPolicyName.authorizationPolicy; + } + + public AuthorizationPolicyName build() { + return new AuthorizationPolicyName(this); + } + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyOrBuilder.java new file mode 100644 index 00000000..84897b0a --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyOrBuilder.java @@ -0,0 +1,321 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface AuthorizationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.AuthorizationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the AuthorizationPolicy resource. It matches pattern
+   * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the AuthorizationPolicy resource. It matches pattern
+   * `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. The action to take when a rule match is found. Possible values
+   * are "ALLOW" or "DENY".
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + /** + * + * + *
+   * Required. The action to take when a rule match is found. Possible values
+   * are "ALLOW" or "DENY".
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy.Action action = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The action. + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Action getAction(); + + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getRulesList(); + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Rule getRules(int index); + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getRulesCount(); + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getRulesOrBuilderList(); + /** + * + * + *
+   * Optional. List of rules to match. Note that at least one of the rules must match in
+   * order for the action specified in the 'action' field to be taken. A rule is
+   * a match if there is a matching source and destination. If left blank, the
+   * action specified in the `action` field will be applied on every request.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy.Rule rules = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy.RuleOrBuilder getRulesOrBuilder( + int index); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyProto.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyProto.java new file mode 100644 index 00000000..69802dea --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/AuthorizationPolicyProto.java @@ -0,0 +1,283 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public final class AuthorizationPolicyProto { + private AuthorizationPolicyProto() {} + + 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_cloud_networksecurity_v1_AuthorizationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_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:google/cloud/networksecurity/v1/author" + + "ization_policy.proto\022\037google.cloud.netwo" + + "rksecurity.v1\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032 googl" + + "e/protobuf/field_mask.proto\032\037google/prot" + + "obuf/timestamp.proto\"\261\t\n\023AuthorizationPo" + + "licy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013description\030\002" + + " \001(\tB\003\340A\001\0224\n\013create_time\030\003 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\0224\n\013update_time\030\004" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022U\n" + + "\006labels\030\005 \003(\0132@.google.cloud.networksecu" + + "rity.v1.AuthorizationPolicy.LabelsEntryB" + + "\003\340A\001\022P\n\006action\030\006 \001(\0162;.google.cloud.netw" + + "orksecurity.v1.AuthorizationPolicy.Actio" + + "nB\003\340A\002\022M\n\005rules\030\007 \003(\01329.google.cloud.net" + + "worksecurity.v1.AuthorizationPolicy.Rule" + + "B\003\340A\001\032\221\004\n\004Rule\022V\n\007sources\030\001 \003(\0132@.google" + + ".cloud.networksecurity.v1.AuthorizationP" + + "olicy.Rule.SourceB\003\340A\001\022`\n\014destinations\030\002" + + " \003(\0132E.google.cloud.networksecurity.v1.A" + + "uthorizationPolicy.Rule.DestinationB\003\340A\001" + + "\0329\n\006Source\022\027\n\nprincipals\030\001 \003(\tB\003\340A\001\022\026\n\ti" + + "p_blocks\030\002 \003(\tB\003\340A\001\032\223\002\n\013Destination\022\022\n\005h" + + "osts\030\001 \003(\tB\003\340A\002\022\022\n\005ports\030\002 \003(\rB\003\340A\002\022\024\n\007m" + + "ethods\030\004 \003(\tB\003\340A\001\022u\n\021http_header_match\030\005" + + " \001(\0132U.google.cloud.networksecurity.v1.A" + + "uthorizationPolicy.Rule.Destination.Http" + + "HeaderMatchB\003\340A\001\032O\n\017HttpHeaderMatch\022\032\n\013r" + + "egex_match\030\002 \001(\tB\003\340A\002H\000\022\030\n\013header_name\030\001" + + " \001(\tB\003\340A\002B\006\n\004type\032-\n\013LabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"5\n\006Action\022\026\n\022AC" + + "TION_UNSPECIFIED\020\000\022\t\n\005ALLOW\020\001\022\010\n\004DENY\020\002:" + + "\216\001\352A\212\001\n2networksecurity.googleapis.com/A" + + "uthorizationPolicy\022Tprojects/{project}/l" + + "ocations/{location}/authorizationPolicie" + + "s/{authorization_policy}\"\204\001\n ListAuthori" + + "zationPoliciesRequest\0229\n\006parent\030\001 \001(\tB)\340" + + "A\002\372A#\n!locations.googleapis.com/Location" + + "\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"" + + "\222\001\n!ListAuthorizationPoliciesResponse\022T\n" + + "\026authorization_policies\030\001 \003(\01324.google.c" + + "loud.networksecurity.v1.AuthorizationPol" + + "icy\022\027\n\017next_page_token\030\002 \001(\t\"i\n\035GetAutho" + + "rizationPolicyRequest\022H\n\004name\030\001 \001(\tB:\340A\002" + + "\372A4\n2networksecurity.googleapis.com/Auth" + + "orizationPolicy\"\355\001\n CreateAuthorizationP" + + "olicyRequest\022J\n\006parent\030\001 \001(\tB:\340A\002\372A4\0222ne" + + "tworksecurity.googleapis.com/Authorizati" + + "onPolicy\022$\n\027authorization_policy_id\030\002 \001(" + + "\tB\003\340A\002\022W\n\024authorization_policy\030\003 \001(\01324.g" + + "oogle.cloud.networksecurity.v1.Authoriza" + + "tionPolicyB\003\340A\002\"\261\001\n UpdateAuthorizationP" + + "olicyRequest\0224\n\013update_mask\030\001 \001(\0132\032.goog" + + "le.protobuf.FieldMaskB\003\340A\001\022W\n\024authorizat" + + "ion_policy\030\002 \001(\01324.google.cloud.networks" + + "ecurity.v1.AuthorizationPolicyB\003\340A\002\"l\n D" + + "eleteAuthorizationPolicyRequest\022H\n\004name\030" + + "\001 \001(\tB:\340A\002\372A4\n2networksecurity.googleapi" + + "s.com/AuthorizationPolicyB\372\001\n#com.google" + + ".cloud.networksecurity.v1B\030Authorization" + + "PolicyProtoP\001ZNgoogle.golang.org/genprot" + + "o/googleapis/cloud/networksecurity/v1;ne" + + "tworksecurity\252\002\037Google.Cloud.NetworkSecu" + + "rity.V1\312\002\037Google\\Cloud\\NetworkSecurity\\V" + + "1\352\002\"Google::Cloud::NetworkSecurity::V1b\006" + + "proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor, + new java.lang.String[] { + "Name", "Description", "CreateTime", "UpdateTime", "Labels", "Action", "Rules", + }); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor = + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor, + new java.lang.String[] { + "Sources", "Destinations", + }); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_descriptor = + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Source_descriptor, + new java.lang.String[] { + "Principals", "IpBlocks", + }); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor = + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor, + new java.lang.String[] { + "Hosts", "Ports", "Methods", "HttpHeaderMatch", + }); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_descriptor = + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_Rule_Destination_HttpHeaderMatch_descriptor, + new java.lang.String[] { + "RegexMatch", "HeaderName", "Type", + }); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_AuthorizationPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_descriptor, + new java.lang.String[] { + "AuthorizationPolicies", "NextPageToken", + }); + internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", "AuthorizationPolicyId", "AuthorizationPolicy", + }); + internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "AuthorizationPolicy", + }); + internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProvider.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProvider.java new file mode 100644 index 00000000..487a0ef0 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProvider.java @@ -0,0 +1,1225 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Specification of certificate provider. Defines the mechanism to obtain the
+ * certificate and private key for peer to peer authentication.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CertificateProvider} + */ +public final class CertificateProvider extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.CertificateProvider) + CertificateProviderOrBuilder { + private static final long serialVersionUID = 0L; + // Use CertificateProvider.newBuilder() to construct. + private CertificateProvider(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CertificateProvider() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CertificateProvider(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CertificateProvider( + 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 18: + { + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder subBuilder = null; + if (typeCase_ == 2) { + subBuilder = ((com.google.cloud.networksecurity.v1.GrpcEndpoint) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.cloud.networksecurity.v1.GrpcEndpoint.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.networksecurity.v1.GrpcEndpoint) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 2; + break; + } + case 26: + { + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder subBuilder = + null; + if (typeCase_ == 3) { + subBuilder = + ((com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_) + .toBuilder(); + } + type_ = + input.readMessage( + com.google.cloud.networksecurity.v1.CertificateProviderInstance.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 3; + 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.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProvider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProvider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CertificateProvider.class, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public enum TypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GRPC_ENDPOINT(2), + CERTIFICATE_PROVIDER_INSTANCE(3), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(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 TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 2: + return GRPC_ENDPOINT; + case 3: + return CERTIFICATE_PROVIDER_INSTANCE; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int GRPC_ENDPOINT_FIELD_NUMBER = 2; + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the cert and private key.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return Whether the grpcEndpoint field is set. + */ + @java.lang.Override + public boolean hasGrpcEndpoint() { + return typeCase_ == 2; + } + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the cert and private key.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return The grpcEndpoint. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint getGrpcEndpoint() { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the cert and private key.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder getGrpcEndpointOrBuilder() { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + + public static final int CERTIFICATE_PROVIDER_INSTANCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return Whether the certificateProviderInstance field is set. + */ + @java.lang.Override + public boolean hasCertificateProviderInstance() { + return typeCase_ == 3; + } + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return The certificateProviderInstance. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance + getCertificateProviderInstance() { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder + getCertificateProviderInstanceOrBuilder() { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + + 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 (typeCase_ == 2) { + output.writeMessage(2, (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_); + } + if (typeCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_); + } + if (typeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_); + } + 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.cloud.networksecurity.v1.CertificateProvider)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.CertificateProvider other = + (com.google.cloud.networksecurity.v1.CertificateProvider) obj; + + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 2: + if (!getGrpcEndpoint().equals(other.getGrpcEndpoint())) return false; + break; + case 3: + if (!getCertificateProviderInstance().equals(other.getCertificateProviderInstance())) + 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(); + switch (typeCase_) { + case 2: + hash = (37 * hash) + GRPC_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getGrpcEndpoint().hashCode(); + break; + case 3: + hash = (37 * hash) + CERTIFICATE_PROVIDER_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getCertificateProviderInstance().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider 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.cloud.networksecurity.v1.CertificateProvider parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider 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.cloud.networksecurity.v1.CertificateProvider parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider 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.cloud.networksecurity.v1.CertificateProvider parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider 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.cloud.networksecurity.v1.CertificateProvider 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; + } + /** + * + * + *
+   * Specification of certificate provider. Defines the mechanism to obtain the
+   * certificate and private key for peer to peer authentication.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CertificateProvider} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.CertificateProvider) + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProvider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProvider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CertificateProvider.class, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.CertificateProvider.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(); + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProvider_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProvider getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProvider build() { + com.google.cloud.networksecurity.v1.CertificateProvider result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProvider buildPartial() { + com.google.cloud.networksecurity.v1.CertificateProvider result = + new com.google.cloud.networksecurity.v1.CertificateProvider(this); + if (typeCase_ == 2) { + if (grpcEndpointBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = grpcEndpointBuilder_.build(); + } + } + if (typeCase_ == 3) { + if (certificateProviderInstanceBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = certificateProviderInstanceBuilder_.build(); + } + } + result.typeCase_ = typeCase_; + 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.cloud.networksecurity.v1.CertificateProvider) { + return mergeFrom((com.google.cloud.networksecurity.v1.CertificateProvider) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.CertificateProvider other) { + if (other == com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance()) + return this; + switch (other.getTypeCase()) { + case GRPC_ENDPOINT: + { + mergeGrpcEndpoint(other.getGrpcEndpoint()); + break; + } + case CERTIFICATE_PROVIDER_INSTANCE: + { + mergeCertificateProviderInstance(other.getCertificateProviderInstance()); + break; + } + case TYPE_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.cloud.networksecurity.v1.CertificateProvider parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.CertificateProvider) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.GrpcEndpoint, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder, + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder> + grpcEndpointBuilder_; + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return Whether the grpcEndpoint field is set. + */ + @java.lang.Override + public boolean hasGrpcEndpoint() { + return typeCase_ == 2; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return The grpcEndpoint. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint getGrpcEndpoint() { + if (grpcEndpointBuilder_ == null) { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } else { + if (typeCase_ == 2) { + return grpcEndpointBuilder_.getMessage(); + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder setGrpcEndpoint(com.google.cloud.networksecurity.v1.GrpcEndpoint value) { + if (grpcEndpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + grpcEndpointBuilder_.setMessage(value); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder setGrpcEndpoint( + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder builderForValue) { + if (grpcEndpointBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + grpcEndpointBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder mergeGrpcEndpoint(com.google.cloud.networksecurity.v1.GrpcEndpoint value) { + if (grpcEndpointBuilder_ == null) { + if (typeCase_ == 2 + && type_ != com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance()) { + type_ = + com.google.cloud.networksecurity.v1.GrpcEndpoint.newBuilder( + (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 2) { + grpcEndpointBuilder_.mergeFrom(value); + } else { + grpcEndpointBuilder_.setMessage(value); + } + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder clearGrpcEndpoint() { + if (grpcEndpointBuilder_ == null) { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + } + grpcEndpointBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder getGrpcEndpointBuilder() { + return getGrpcEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder getGrpcEndpointOrBuilder() { + if ((typeCase_ == 2) && (grpcEndpointBuilder_ != null)) { + return grpcEndpointBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the cert and private key.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.GrpcEndpoint, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder, + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder> + getGrpcEndpointFieldBuilder() { + if (grpcEndpointBuilder_ == null) { + if (!(typeCase_ == 2)) { + type_ = com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + grpcEndpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.GrpcEndpoint, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder, + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder>( + (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 2; + onChanged(); + ; + return grpcEndpointBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProviderInstance, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder> + certificateProviderInstanceBuilder_; + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return Whether the certificateProviderInstance field is set. + */ + @java.lang.Override + public boolean hasCertificateProviderInstance() { + return typeCase_ == 3; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return The certificateProviderInstance. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance + getCertificateProviderInstance() { + if (certificateProviderInstanceBuilder_ == null) { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } else { + if (typeCase_ == 3) { + return certificateProviderInstanceBuilder_.getMessage(); + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder setCertificateProviderInstance( + com.google.cloud.networksecurity.v1.CertificateProviderInstance value) { + if (certificateProviderInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + certificateProviderInstanceBuilder_.setMessage(value); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder setCertificateProviderInstance( + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder builderForValue) { + if (certificateProviderInstanceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + certificateProviderInstanceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder mergeCertificateProviderInstance( + com.google.cloud.networksecurity.v1.CertificateProviderInstance value) { + if (certificateProviderInstanceBuilder_ == null) { + if (typeCase_ == 3 + && type_ + != com.google.cloud.networksecurity.v1.CertificateProviderInstance + .getDefaultInstance()) { + type_ = + com.google.cloud.networksecurity.v1.CertificateProviderInstance.newBuilder( + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 3) { + certificateProviderInstanceBuilder_.mergeFrom(value); + } else { + certificateProviderInstanceBuilder_.setMessage(value); + } + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder clearCertificateProviderInstance() { + if (certificateProviderInstanceBuilder_ == null) { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + } + certificateProviderInstanceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder + getCertificateProviderInstanceBuilder() { + return getCertificateProviderInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder + getCertificateProviderInstanceOrBuilder() { + if ((typeCase_ == 3) && (certificateProviderInstanceBuilder_ != null)) { + return certificateProviderInstanceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProviderInstance, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder> + getCertificateProviderInstanceFieldBuilder() { + if (certificateProviderInstanceBuilder_ == null) { + if (!(typeCase_ == 3)) { + type_ = + com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + certificateProviderInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProviderInstance, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder>( + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 3; + onChanged(); + ; + return certificateProviderInstanceBuilder_; + } + + @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.cloud.networksecurity.v1.CertificateProvider) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.CertificateProvider) + private static final com.google.cloud.networksecurity.v1.CertificateProvider DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.CertificateProvider(); + } + + public static com.google.cloud.networksecurity.v1.CertificateProvider getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CertificateProvider parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CertificateProvider(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.cloud.networksecurity.v1.CertificateProvider getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstance.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstance.java new file mode 100644 index 00000000..5c6552b1 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstance.java @@ -0,0 +1,666 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Specification of a TLS certificate provider instance. Workloads may have one
+ * or more CertificateProvider instances (plugins) and one of them is enabled
+ * and configured by specifying this message. Workloads use the values from this
+ * message to locate and load the CertificateProvider instance configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CertificateProviderInstance} + */ +public final class CertificateProviderInstance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.CertificateProviderInstance) + CertificateProviderInstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use CertificateProviderInstance.newBuilder() to construct. + private CertificateProviderInstance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CertificateProviderInstance() { + pluginInstance_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CertificateProviderInstance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CertificateProviderInstance( + 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(); + + pluginInstance_ = 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.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CertificateProviderInstance.class, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder.class); + } + + public static final int PLUGIN_INSTANCE_FIELD_NUMBER = 1; + private volatile java.lang.Object pluginInstance_; + /** + * + * + *
+   * Required. Plugin instance name, used to locate and load CertificateProvider instance
+   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+   * Authority Service certificate provider instance.
+   * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pluginInstance. + */ + @java.lang.Override + public java.lang.String getPluginInstance() { + java.lang.Object ref = pluginInstance_; + 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(); + pluginInstance_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Plugin instance name, used to locate and load CertificateProvider instance
+   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+   * Authority Service certificate provider instance.
+   * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for pluginInstance. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPluginInstanceBytes() { + java.lang.Object ref = pluginInstance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pluginInstance_ = 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(pluginInstance_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pluginInstance_); + } + 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(pluginInstance_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pluginInstance_); + } + 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.cloud.networksecurity.v1.CertificateProviderInstance)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.CertificateProviderInstance other = + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) obj; + + if (!getPluginInstance().equals(other.getPluginInstance())) 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) + PLUGIN_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getPluginInstance().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance 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.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance 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.cloud.networksecurity.v1.CertificateProviderInstance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance 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.cloud.networksecurity.v1.CertificateProviderInstance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance 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.cloud.networksecurity.v1.CertificateProviderInstance 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; + } + /** + * + * + *
+   * Specification of a TLS certificate provider instance. Workloads may have one
+   * or more CertificateProvider instances (plugins) and one of them is enabled
+   * and configured by specifying this message. Workloads use the values from this
+   * message to locate and load the CertificateProvider instance configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CertificateProviderInstance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.CertificateProviderInstance) + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CertificateProviderInstance.class, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.CertificateProviderInstance.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(); + pluginInstance_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance build() { + com.google.cloud.networksecurity.v1.CertificateProviderInstance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance buildPartial() { + com.google.cloud.networksecurity.v1.CertificateProviderInstance result = + new com.google.cloud.networksecurity.v1.CertificateProviderInstance(this); + result.pluginInstance_ = pluginInstance_; + 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.cloud.networksecurity.v1.CertificateProviderInstance) { + return mergeFrom((com.google.cloud.networksecurity.v1.CertificateProviderInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.CertificateProviderInstance other) { + if (other + == com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance()) + return this; + if (!other.getPluginInstance().isEmpty()) { + pluginInstance_ = other.pluginInstance_; + 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.cloud.networksecurity.v1.CertificateProviderInstance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object pluginInstance_ = ""; + /** + * + * + *
+     * Required. Plugin instance name, used to locate and load CertificateProvider instance
+     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+     * Authority Service certificate provider instance.
+     * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pluginInstance. + */ + public java.lang.String getPluginInstance() { + java.lang.Object ref = pluginInstance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pluginInstance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Plugin instance name, used to locate and load CertificateProvider instance
+     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+     * Authority Service certificate provider instance.
+     * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for pluginInstance. + */ + public com.google.protobuf.ByteString getPluginInstanceBytes() { + java.lang.Object ref = pluginInstance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pluginInstance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Plugin instance name, used to locate and load CertificateProvider instance
+     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+     * Authority Service certificate provider instance.
+     * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The pluginInstance to set. + * @return This builder for chaining. + */ + public Builder setPluginInstance(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pluginInstance_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Plugin instance name, used to locate and load CertificateProvider instance
+     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+     * Authority Service certificate provider instance.
+     * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPluginInstance() { + + pluginInstance_ = getDefaultInstance().getPluginInstance(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Plugin instance name, used to locate and load CertificateProvider instance
+     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+     * Authority Service certificate provider instance.
+     * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for pluginInstance to set. + * @return This builder for chaining. + */ + public Builder setPluginInstanceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pluginInstance_ = 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.cloud.networksecurity.v1.CertificateProviderInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.CertificateProviderInstance) + private static final com.google.cloud.networksecurity.v1.CertificateProviderInstance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.CertificateProviderInstance(); + } + + public static com.google.cloud.networksecurity.v1.CertificateProviderInstance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CertificateProviderInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CertificateProviderInstance(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.cloud.networksecurity.v1.CertificateProviderInstance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstanceOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstanceOrBuilder.java new file mode 100644 index 00000000..4bfde71f --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderInstanceOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +public interface CertificateProviderInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.CertificateProviderInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Plugin instance name, used to locate and load CertificateProvider instance
+   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+   * Authority Service certificate provider instance.
+   * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pluginInstance. + */ + java.lang.String getPluginInstance(); + /** + * + * + *
+   * Required. Plugin instance name, used to locate and load CertificateProvider instance
+   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
+   * Authority Service certificate provider instance.
+   * 
+ * + * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for pluginInstance. + */ + com.google.protobuf.ByteString getPluginInstanceBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderOrBuilder.java new file mode 100644 index 00000000..e62cd941 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CertificateProviderOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +public interface CertificateProviderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.CertificateProvider) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the cert and private key.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return Whether the grpcEndpoint field is set. + */ + boolean hasGrpcEndpoint(); + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the cert and private key.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return The grpcEndpoint. + */ + com.google.cloud.networksecurity.v1.GrpcEndpoint getGrpcEndpoint(); + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the cert and private key.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder getGrpcEndpointOrBuilder(); + + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return Whether the certificateProviderInstance field is set. + */ + boolean hasCertificateProviderInstance(); + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return The certificateProviderInstance. + */ + com.google.cloud.networksecurity.v1.CertificateProviderInstance getCertificateProviderInstance(); + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder + getCertificateProviderInstanceOrBuilder(); + + public com.google.cloud.networksecurity.v1.CertificateProvider.TypeCase getTypeCase(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicy.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicy.java new file mode 100644 index 00000000..ced1a724 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicy.java @@ -0,0 +1,2842 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * ClientTlsPolicy is a resource that specifies how a client should authenticate
+ * connections to backends of a service. This resource itself does not affect
+ * configuration unless it is attached to a backend service resource.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ClientTlsPolicy} + */ +public final class ClientTlsPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ClientTlsPolicy) + ClientTlsPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientTlsPolicy.newBuilder() to construct. + private ClientTlsPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClientTlsPolicy() { + name_ = ""; + description_ = ""; + sni_ = ""; + serverValidationCa_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClientTlsPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClientTlsPolicy( + 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(); + + description_ = s; + break; + } + case 26: + { + 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 34: + { + 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 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + sni_ = s; + break; + } + case 58: + { + com.google.cloud.networksecurity.v1.CertificateProvider.Builder subBuilder = null; + if (clientCertificate_ != null) { + subBuilder = clientCertificate_.toBuilder(); + } + clientCertificate_ = + input.readMessage( + com.google.cloud.networksecurity.v1.CertificateProvider.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientCertificate_); + clientCertificate_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + serverValidationCa_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + serverValidationCa_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.ValidationCA.parser(), + extensionRegistry)); + 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)) { + serverValidationCa_ = java.util.Collections.unmodifiableList(serverValidationCa_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.class, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the ClientTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+   * 
+ * + * 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. Name of the ClientTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+   * 
+ * + * 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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SNI_FIELD_NUMBER = 6; + private volatile java.lang.Object sni_; + /** + * + * + *
+   * Optional. Server Name Indication string to present to the server during TLS
+   * handshake. E.g: "secure.example.com".
+   * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sni. + */ + @java.lang.Override + public java.lang.String getSni() { + java.lang.Object ref = sni_; + 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(); + sni_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Server Name Indication string to present to the server during TLS
+   * handshake. E.g: "secure.example.com".
+   * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sni. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSniBytes() { + java.lang.Object ref = sni_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sni_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 7; + private com.google.cloud.networksecurity.v1.CertificateProvider clientCertificate_; + /** + * + * + *
+   * Optional. Defines a mechanism to provision client identity (public and private keys)
+   * for peer to peer authentication. The presence of this dictates mTLS.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clientCertificate field is set. + */ + @java.lang.Override + public boolean hasClientCertificate() { + return clientCertificate_ != null; + } + /** + * + * + *
+   * Optional. Defines a mechanism to provision client identity (public and private keys)
+   * for peer to peer authentication. The presence of this dictates mTLS.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clientCertificate. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProvider getClientCertificate() { + return clientCertificate_ == null + ? com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance() + : clientCertificate_; + } + /** + * + * + *
+   * Optional. Defines a mechanism to provision client identity (public and private keys)
+   * for peer to peer authentication. The presence of this dictates mTLS.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder + getClientCertificateOrBuilder() { + return getClientCertificate(); + } + + public static final int SERVER_VALIDATION_CA_FIELD_NUMBER = 8; + private java.util.List serverValidationCa_; + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getServerValidationCaList() { + return serverValidationCa_; + } + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getServerValidationCaOrBuilderList() { + return serverValidationCa_; + } + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getServerValidationCaCount() { + return serverValidationCa_.size(); + } + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCA getServerValidationCa(int index) { + return serverValidationCa_.get(index); + } + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCAOrBuilder getServerValidationCaOrBuilder( + int index) { + return serverValidationCa_.get(index); + } + + 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(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sni_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sni_); + } + if (clientCertificate_ != null) { + output.writeMessage(7, getClientCertificate()); + } + for (int i = 0; i < serverValidationCa_.size(); i++) { + output.writeMessage(8, serverValidationCa_.get(i)); + } + 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(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sni_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sni_); + } + if (clientCertificate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getClientCertificate()); + } + for (int i = 0; i < serverValidationCa_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, serverValidationCa_.get(i)); + } + 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.cloud.networksecurity.v1.ClientTlsPolicy)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ClientTlsPolicy other = + (com.google.cloud.networksecurity.v1.ClientTlsPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) 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 (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getSni().equals(other.getSni())) return false; + if (hasClientCertificate() != other.hasClientCertificate()) return false; + if (hasClientCertificate()) { + if (!getClientCertificate().equals(other.getClientCertificate())) return false; + } + if (!getServerValidationCaList().equals(other.getServerValidationCaList())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().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 (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + SNI_FIELD_NUMBER; + hash = (53 * hash) + getSni().hashCode(); + if (hasClientCertificate()) { + hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getClientCertificate().hashCode(); + } + if (getServerValidationCaCount() > 0) { + hash = (37 * hash) + SERVER_VALIDATION_CA_FIELD_NUMBER; + hash = (53 * hash) + getServerValidationCaList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy 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.cloud.networksecurity.v1.ClientTlsPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy 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.cloud.networksecurity.v1.ClientTlsPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy 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.cloud.networksecurity.v1.ClientTlsPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy 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.cloud.networksecurity.v1.ClientTlsPolicy 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; + } + /** + * + * + *
+   * ClientTlsPolicy is a resource that specifies how a client should authenticate
+   * connections to backends of a service. This resource itself does not affect
+   * configuration unless it is attached to a backend service resource.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ClientTlsPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ClientTlsPolicy) + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.class, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.ClientTlsPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServerValidationCaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + sni_ = ""; + + if (clientCertificateBuilder_ == null) { + clientCertificate_ = null; + } else { + clientCertificate_ = null; + clientCertificateBuilder_ = null; + } + if (serverValidationCaBuilder_ == null) { + serverValidationCa_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + serverValidationCaBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicy build() { + com.google.cloud.networksecurity.v1.ClientTlsPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicy buildPartial() { + com.google.cloud.networksecurity.v1.ClientTlsPolicy result = + new com.google.cloud.networksecurity.v1.ClientTlsPolicy(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.sni_ = sni_; + if (clientCertificateBuilder_ == null) { + result.clientCertificate_ = clientCertificate_; + } else { + result.clientCertificate_ = clientCertificateBuilder_.build(); + } + if (serverValidationCaBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serverValidationCa_ = java.util.Collections.unmodifiableList(serverValidationCa_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serverValidationCa_ = serverValidationCa_; + } else { + result.serverValidationCa_ = serverValidationCaBuilder_.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.cloud.networksecurity.v1.ClientTlsPolicy) { + return mergeFrom((com.google.cloud.networksecurity.v1.ClientTlsPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.ClientTlsPolicy other) { + if (other == com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getSni().isEmpty()) { + sni_ = other.sni_; + onChanged(); + } + if (other.hasClientCertificate()) { + mergeClientCertificate(other.getClientCertificate()); + } + if (serverValidationCaBuilder_ == null) { + if (!other.serverValidationCa_.isEmpty()) { + if (serverValidationCa_.isEmpty()) { + serverValidationCa_ = other.serverValidationCa_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServerValidationCaIsMutable(); + serverValidationCa_.addAll(other.serverValidationCa_); + } + onChanged(); + } + } else { + if (!other.serverValidationCa_.isEmpty()) { + if (serverValidationCaBuilder_.isEmpty()) { + serverValidationCaBuilder_.dispose(); + serverValidationCaBuilder_ = null; + serverValidationCa_ = other.serverValidationCa_; + bitField0_ = (bitField0_ & ~0x00000002); + serverValidationCaBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServerValidationCaFieldBuilder() + : null; + } else { + serverValidationCaBuilder_.addAllMessages(other.serverValidationCa_); + } + } + } + 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.cloud.networksecurity.v1.ClientTlsPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ClientTlsPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the ClientTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+     * 
+ * + * 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. Name of the ClientTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+     * 
+ * + * 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. Name of the ClientTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+     * 
+ * + * 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. Name of the ClientTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the ClientTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+     * 
+ * + * 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 description_ = ""; + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Free-text description of the resource.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + 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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object sni_ = ""; + /** + * + * + *
+     * Optional. Server Name Indication string to present to the server during TLS
+     * handshake. E.g: "secure.example.com".
+     * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sni. + */ + public java.lang.String getSni() { + java.lang.Object ref = sni_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sni_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Server Name Indication string to present to the server during TLS
+     * handshake. E.g: "secure.example.com".
+     * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sni. + */ + public com.google.protobuf.ByteString getSniBytes() { + java.lang.Object ref = sni_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sni_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Server Name Indication string to present to the server during TLS
+     * handshake. E.g: "secure.example.com".
+     * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The sni to set. + * @return This builder for chaining. + */ + public Builder setSni(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sni_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Server Name Indication string to present to the server during TLS
+     * handshake. E.g: "secure.example.com".
+     * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSni() { + + sni_ = getDefaultInstance().getSni(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Server Name Indication string to present to the server during TLS
+     * handshake. E.g: "secure.example.com".
+     * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for sni to set. + * @return This builder for chaining. + */ + public Builder setSniBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sni_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networksecurity.v1.CertificateProvider clientCertificate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProvider, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder> + clientCertificateBuilder_; + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clientCertificate field is set. + */ + public boolean hasClientCertificate() { + return clientCertificateBuilder_ != null || clientCertificate_ != null; + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clientCertificate. + */ + public com.google.cloud.networksecurity.v1.CertificateProvider getClientCertificate() { + if (clientCertificateBuilder_ == null) { + return clientCertificate_ == null + ? com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance() + : clientCertificate_; + } else { + return clientCertificateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClientCertificate( + com.google.cloud.networksecurity.v1.CertificateProvider value) { + if (clientCertificateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientCertificate_ = value; + onChanged(); + } else { + clientCertificateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setClientCertificate( + com.google.cloud.networksecurity.v1.CertificateProvider.Builder builderForValue) { + if (clientCertificateBuilder_ == null) { + clientCertificate_ = builderForValue.build(); + onChanged(); + } else { + clientCertificateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeClientCertificate( + com.google.cloud.networksecurity.v1.CertificateProvider value) { + if (clientCertificateBuilder_ == null) { + if (clientCertificate_ != null) { + clientCertificate_ = + com.google.cloud.networksecurity.v1.CertificateProvider.newBuilder(clientCertificate_) + .mergeFrom(value) + .buildPartial(); + } else { + clientCertificate_ = value; + } + onChanged(); + } else { + clientCertificateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearClientCertificate() { + if (clientCertificateBuilder_ == null) { + clientCertificate_ = null; + onChanged(); + } else { + clientCertificate_ = null; + clientCertificateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.CertificateProvider.Builder + getClientCertificateBuilder() { + + onChanged(); + return getClientCertificateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder + getClientCertificateOrBuilder() { + if (clientCertificateBuilder_ != null) { + return clientCertificateBuilder_.getMessageOrBuilder(); + } else { + return clientCertificate_ == null + ? com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance() + : clientCertificate_; + } + } + /** + * + * + *
+     * Optional. Defines a mechanism to provision client identity (public and private keys)
+     * for peer to peer authentication. The presence of this dictates mTLS.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProvider, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder> + getClientCertificateFieldBuilder() { + if (clientCertificateBuilder_ == null) { + clientCertificateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProvider, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder>( + getClientCertificate(), getParentForChildren(), isClean()); + clientCertificate_ = null; + } + return clientCertificateBuilder_; + } + + private java.util.List serverValidationCa_ = + java.util.Collections.emptyList(); + + private void ensureServerValidationCaIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serverValidationCa_ = + new java.util.ArrayList( + serverValidationCa_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ValidationCA, + com.google.cloud.networksecurity.v1.ValidationCA.Builder, + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder> + serverValidationCaBuilder_; + + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getServerValidationCaList() { + if (serverValidationCaBuilder_ == null) { + return java.util.Collections.unmodifiableList(serverValidationCa_); + } else { + return serverValidationCaBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getServerValidationCaCount() { + if (serverValidationCaBuilder_ == null) { + return serverValidationCa_.size(); + } else { + return serverValidationCaBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA getServerValidationCa(int index) { + if (serverValidationCaBuilder_ == null) { + return serverValidationCa_.get(index); + } else { + return serverValidationCaBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setServerValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA value) { + if (serverValidationCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerValidationCaIsMutable(); + serverValidationCa_.set(index, value); + onChanged(); + } else { + serverValidationCaBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setServerValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA.Builder builderForValue) { + if (serverValidationCaBuilder_ == null) { + ensureServerValidationCaIsMutable(); + serverValidationCa_.set(index, builderForValue.build()); + onChanged(); + } else { + serverValidationCaBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addServerValidationCa(com.google.cloud.networksecurity.v1.ValidationCA value) { + if (serverValidationCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerValidationCaIsMutable(); + serverValidationCa_.add(value); + onChanged(); + } else { + serverValidationCaBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addServerValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA value) { + if (serverValidationCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerValidationCaIsMutable(); + serverValidationCa_.add(index, value); + onChanged(); + } else { + serverValidationCaBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addServerValidationCa( + com.google.cloud.networksecurity.v1.ValidationCA.Builder builderForValue) { + if (serverValidationCaBuilder_ == null) { + ensureServerValidationCaIsMutable(); + serverValidationCa_.add(builderForValue.build()); + onChanged(); + } else { + serverValidationCaBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addServerValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA.Builder builderForValue) { + if (serverValidationCaBuilder_ == null) { + ensureServerValidationCaIsMutable(); + serverValidationCa_.add(index, builderForValue.build()); + onChanged(); + } else { + serverValidationCaBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllServerValidationCa( + java.lang.Iterable values) { + if (serverValidationCaBuilder_ == null) { + ensureServerValidationCaIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serverValidationCa_); + onChanged(); + } else { + serverValidationCaBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearServerValidationCa() { + if (serverValidationCaBuilder_ == null) { + serverValidationCa_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serverValidationCaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeServerValidationCa(int index) { + if (serverValidationCaBuilder_ == null) { + ensureServerValidationCaIsMutable(); + serverValidationCa_.remove(index); + onChanged(); + } else { + serverValidationCaBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA.Builder getServerValidationCaBuilder( + int index) { + return getServerValidationCaFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCAOrBuilder getServerValidationCaOrBuilder( + int index) { + if (serverValidationCaBuilder_ == null) { + return serverValidationCa_.get(index); + } else { + return serverValidationCaBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getServerValidationCaOrBuilderList() { + if (serverValidationCaBuilder_ != null) { + return serverValidationCaBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serverValidationCa_); + } + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA.Builder addServerValidationCaBuilder() { + return getServerValidationCaFieldBuilder() + .addBuilder(com.google.cloud.networksecurity.v1.ValidationCA.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA.Builder addServerValidationCaBuilder( + int index) { + return getServerValidationCaFieldBuilder() + .addBuilder(index, com.google.cloud.networksecurity.v1.ValidationCA.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the server certificate. If empty, client does not validate the
+     * server certificate.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getServerValidationCaBuilderList() { + return getServerValidationCaFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ValidationCA, + com.google.cloud.networksecurity.v1.ValidationCA.Builder, + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder> + getServerValidationCaFieldBuilder() { + if (serverValidationCaBuilder_ == null) { + serverValidationCaBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ValidationCA, + com.google.cloud.networksecurity.v1.ValidationCA.Builder, + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder>( + serverValidationCa_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + serverValidationCa_ = null; + } + return serverValidationCaBuilder_; + } + + @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.cloud.networksecurity.v1.ClientTlsPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ClientTlsPolicy) + private static final com.google.cloud.networksecurity.v1.ClientTlsPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ClientTlsPolicy(); + } + + public static com.google.cloud.networksecurity.v1.ClientTlsPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientTlsPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientTlsPolicy(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.cloud.networksecurity.v1.ClientTlsPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyName.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyName.java new file mode 100644 index 00000000..1d32bc81 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyName.java @@ -0,0 +1,227 @@ +/* + * 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.cloud.networksecurity.v1; + +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 ClientTlsPolicyName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLIENT_TLS_POLICY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String clientTlsPolicy; + + @Deprecated + protected ClientTlsPolicyName() { + project = null; + location = null; + clientTlsPolicy = null; + } + + private ClientTlsPolicyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + clientTlsPolicy = Preconditions.checkNotNull(builder.getClientTlsPolicy()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getClientTlsPolicy() { + return clientTlsPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ClientTlsPolicyName of(String project, String location, String clientTlsPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setClientTlsPolicy(clientTlsPolicy) + .build(); + } + + public static String format(String project, String location, String clientTlsPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setClientTlsPolicy(clientTlsPolicy) + .build() + .toString(); + } + + public static ClientTlsPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLIENT_TLS_POLICY.validatedMatch( + formattedString, "ClientTlsPolicyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("client_tls_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 (ClientTlsPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLIENT_TLS_POLICY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (clientTlsPolicy != null) { + fieldMapBuilder.put("client_tls_policy", clientTlsPolicy); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLIENT_TLS_POLICY.instantiate( + "project", project, "location", location, "client_tls_policy", clientTlsPolicy); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ClientTlsPolicyName that = ((ClientTlsPolicyName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.clientTlsPolicy, that.clientTlsPolicy); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(clientTlsPolicy); + return h; + } + + /** Builder for projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}. */ + public static class Builder { + private String project; + private String location; + private String clientTlsPolicy; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getClientTlsPolicy() { + return clientTlsPolicy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setClientTlsPolicy(String clientTlsPolicy) { + this.clientTlsPolicy = clientTlsPolicy; + return this; + } + + private Builder(ClientTlsPolicyName clientTlsPolicyName) { + this.project = clientTlsPolicyName.project; + this.location = clientTlsPolicyName.location; + this.clientTlsPolicy = clientTlsPolicyName.clientTlsPolicy; + } + + public ClientTlsPolicyName build() { + return new ClientTlsPolicyName(this); + } + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyOrBuilder.java new file mode 100644 index 00000000..e1aeee81 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyOrBuilder.java @@ -0,0 +1,356 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ClientTlsPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ClientTlsPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the ClientTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the ClientTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Free-text description of the resource.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Server Name Indication string to present to the server during TLS
+   * handshake. E.g: "secure.example.com".
+   * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The sni. + */ + java.lang.String getSni(); + /** + * + * + *
+   * Optional. Server Name Indication string to present to the server during TLS
+   * handshake. E.g: "secure.example.com".
+   * 
+ * + * string sni = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for sni. + */ + com.google.protobuf.ByteString getSniBytes(); + + /** + * + * + *
+   * Optional. Defines a mechanism to provision client identity (public and private keys)
+   * for peer to peer authentication. The presence of this dictates mTLS.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the clientCertificate field is set. + */ + boolean hasClientCertificate(); + /** + * + * + *
+   * Optional. Defines a mechanism to provision client identity (public and private keys)
+   * for peer to peer authentication. The presence of this dictates mTLS.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The clientCertificate. + */ + com.google.cloud.networksecurity.v1.CertificateProvider getClientCertificate(); + /** + * + * + *
+   * Optional. Defines a mechanism to provision client identity (public and private keys)
+   * for peer to peer authentication. The presence of this dictates mTLS.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProvider client_certificate = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder getClientCertificateOrBuilder(); + + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getServerValidationCaList(); + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.ValidationCA getServerValidationCa(int index); + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getServerValidationCaCount(); + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getServerValidationCaOrBuilderList(); + /** + * + * + *
+   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
+   * validate the server certificate. If empty, client does not validate the
+   * server certificate.
+   * 
+ * + * + * repeated .google.cloud.networksecurity.v1.ValidationCA server_validation_ca = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder getServerValidationCaOrBuilder( + int index); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyProto.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyProto.java new file mode 100644 index 00000000..d9e96d38 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ClientTlsPolicyProto.java @@ -0,0 +1,221 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public final class ClientTlsPolicyProto { + private ClientTlsPolicyProto() {} + + 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_cloud_networksecurity_v1_ClientTlsPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/networksecurity/v1/client" + + "_tls_policy.proto\022\037google.cloud.networks" + + "ecurity.v1\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032)google/c" + + "loud/networksecurity/v1/tls.proto\032 googl" + + "e/protobuf/field_mask.proto\032\037google/prot" + + "obuf/timestamp.proto\"\354\004\n\017ClientTlsPolicy" + + "\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013description\030\002 \001(\t" + + "B\003\340A\001\0224\n\013create_time\030\003 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\004 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022Q\n\006lab" + + "els\030\005 \003(\0132<.google.cloud.networksecurity" + + ".v1.ClientTlsPolicy.LabelsEntryB\003\340A\001\022\020\n\003" + + "sni\030\006 \001(\tB\003\340A\001\022U\n\022client_certificate\030\007 \001" + + "(\01324.google.cloud.networksecurity.v1.Cer" + + "tificateProviderB\003\340A\001\022P\n\024server_validati" + + "on_ca\030\010 \003(\0132-.google.cloud.networksecuri" + + "ty.v1.ValidationCAB\003\340A\001\032-\n\013LabelsEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\202\001\352A\177\n.ne" + + "tworksecurity.googleapis.com/ClientTlsPo" + + "licy\022Mprojects/{project}/locations/{loca" + + "tion}/clientTlsPolicies/{client_tls_poli" + + "cy}\"\200\001\n\034ListClientTlsPoliciesRequest\0229\n\006" + + "parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleap" + + "is.com/Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\"\207\001\n\035ListClientTlsPolicies" + + "Response\022M\n\023client_tls_policies\030\001 \003(\01320." + + "google.cloud.networksecurity.v1.ClientTl" + + "sPolicy\022\027\n\017next_page_token\030\002 \001(\t\"a\n\031GetC" + + "lientTlsPolicyRequest\022D\n\004name\030\001 \001(\tB6\340A\002" + + "\372A0\n.networksecurity.googleapis.com/Clie" + + "ntTlsPolicy\"\333\001\n\034CreateClientTlsPolicyReq" + + "uest\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.networksec" + + "urity.googleapis.com/ClientTlsPolicy\022!\n\024" + + "client_tls_policy_id\030\002 \001(\tB\003\340A\002\022P\n\021clien" + + "t_tls_policy\030\003 \001(\01320.google.cloud.networ" + + "ksecurity.v1.ClientTlsPolicyB\003\340A\002\"\246\001\n\034Up" + + "dateClientTlsPolicyRequest\0224\n\013update_mas" + + "k\030\001 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001" + + "\022P\n\021client_tls_policy\030\002 \001(\01320.google.clo" + + "ud.networksecurity.v1.ClientTlsPolicyB\003\340" + + "A\002\"d\n\034DeleteClientTlsPolicyRequest\022D\n\004na" + + "me\030\001 \001(\tB6\340A\002\372A0\n.networksecurity.google" + + "apis.com/ClientTlsPolicyB\366\001\n#com.google." + + "cloud.networksecurity.v1B\024ClientTlsPolic" + + "yProtoP\001ZNgoogle.golang.org/genproto/goo" + + "gleapis/cloud/networksecurity/v1;network" + + "security\252\002\037Google.Cloud.NetworkSecurity." + + "V1\312\002\037Google\\Cloud\\NetworkSecurity\\V1\352\002\"G" + + "oogle::Cloud::NetworkSecurity::V1b\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.networksecurity.v1.TlsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_descriptor, + new java.lang.String[] { + "Name", + "Description", + "CreateTime", + "UpdateTime", + "Labels", + "Sni", + "ClientCertificate", + "ServerValidationCa", + }); + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ClientTlsPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_descriptor, + new java.lang.String[] { + "ClientTlsPolicies", "NextPageToken", + }); + internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", "ClientTlsPolicyId", "ClientTlsPolicy", + }); + internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "ClientTlsPolicy", + }); + internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.networksecurity.v1.TlsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CommonProto.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CommonProto.java new file mode 100644 index 00000000..e1e36d32 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CommonProto.java @@ -0,0 +1,92 @@ +/* + * 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/cloud/networksecurity/v1/common.proto + +package com.google.cloud.networksecurity.v1; + +public final class CommonProto { + private CommonProto() {} + + 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_cloud_networksecurity_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_OperationMetadata_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,google/cloud/networksecurity/v1/common" + + ".proto\022\037google.cloud.networksecurity.v1\032" + + "\037google/api/field_behavior.proto\032\037google" + + "/protobuf/timestamp.proto\"\200\002\n\021OperationM" + + "etadata\0224\n\013create_time\030\001 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132" + + "\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006targ" + + "et\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016stat" + + "us_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_cance" + + "llation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB" + + "\003\340A\003B\355\001\n#com.google.cloud.networksecurit" + + "y.v1B\013CommonProtoP\001ZNgoogle.golang.org/g" + + "enproto/googleapis/cloud/networksecurity" + + "/v1;networksecurity\252\002\037Google.Cloud.Netwo" + + "rkSecurity.V1\312\002\037Google\\Cloud\\NetworkSecu" + + "rity\\V1\352\002\"Google::Cloud::NetworkSecurity" + + "::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_networksecurity_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networksecurity_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequest.java new file mode 100644 index 00000000..f611460e --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequest.java @@ -0,0 +1,1181 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the CreateAuthorizationPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest} + */ +public final class CreateAuthorizationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) + CreateAuthorizationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAuthorizationPolicyRequest.newBuilder() to construct. + private CreateAuthorizationPolicyRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAuthorizationPolicyRequest() { + parent_ = ""; + authorizationPolicyId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAuthorizationPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAuthorizationPolicyRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + authorizationPolicyId_ = s; + break; + } + case 26: + { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder subBuilder = null; + if (authorizationPolicy_ != null) { + subBuilder = authorizationPolicy_.toBuilder(); + } + authorizationPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(authorizationPolicy_); + authorizationPolicy_ = 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource of the AuthorizationPolicy. Must be in the
+   * format `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the AuthorizationPolicy. Must be in the
+   * format `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 AUTHORIZATION_POLICY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object authorizationPolicyId_; + /** + * + * + *
+   * Required. Short name of the AuthorizationPolicy resource to be created.
+   * This value should be 1-63 characters long, containing only
+   * letters, numbers, hyphens, and underscores, and should not start
+   * with a number. E.g. "authz_policy".
+   * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The authorizationPolicyId. + */ + @java.lang.Override + public java.lang.String getAuthorizationPolicyId() { + java.lang.Object ref = authorizationPolicyId_; + 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(); + authorizationPolicyId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Short name of the AuthorizationPolicy resource to be created.
+   * This value should be 1-63 characters long, containing only
+   * letters, numbers, hyphens, and underscores, and should not start
+   * with a number. E.g. "authz_policy".
+   * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for authorizationPolicyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizationPolicyIdBytes() { + java.lang.Object ref = authorizationPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizationPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHORIZATION_POLICY_FIELD_NUMBER = 3; + private com.google.cloud.networksecurity.v1.AuthorizationPolicy authorizationPolicy_; + /** + * + * + *
+   * Required. AuthorizationPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizationPolicy field is set. + */ + @java.lang.Override + public boolean hasAuthorizationPolicy() { + return authorizationPolicy_ != null; + } + /** + * + * + *
+   * Required. AuthorizationPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizationPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy() { + return authorizationPolicy_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance() + : authorizationPolicy_; + } + /** + * + * + *
+   * Required. AuthorizationPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPolicyOrBuilder() { + return getAuthorizationPolicy(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizationPolicyId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, authorizationPolicyId_); + } + if (authorizationPolicy_ != null) { + output.writeMessage(3, getAuthorizationPolicy()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizationPolicyId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, authorizationPolicyId_); + } + if (authorizationPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAuthorizationPolicy()); + } + 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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest other = + (com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAuthorizationPolicyId().equals(other.getAuthorizationPolicyId())) return false; + if (hasAuthorizationPolicy() != other.hasAuthorizationPolicy()) return false; + if (hasAuthorizationPolicy()) { + if (!getAuthorizationPolicy().equals(other.getAuthorizationPolicy())) 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) + AUTHORIZATION_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationPolicyId().hashCode(); + if (hasAuthorizationPolicy()) { + hash = (37 * hash) + AUTHORIZATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest 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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest 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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + 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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest 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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest 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 used by the CreateAuthorizationPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest.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_ = ""; + + authorizationPolicyId_ = ""; + + if (authorizationPolicyBuilder_ == null) { + authorizationPolicy_ = null; + } else { + authorizationPolicy_ = null; + authorizationPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest build() { + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest result = + new com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest(this); + result.parent_ = parent_; + result.authorizationPolicyId_ = authorizationPolicyId_; + if (authorizationPolicyBuilder_ == null) { + result.authorizationPolicy_ = authorizationPolicy_; + } else { + result.authorizationPolicy_ = authorizationPolicyBuilder_.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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getAuthorizationPolicyId().isEmpty()) { + authorizationPolicyId_ = other.authorizationPolicyId_; + onChanged(); + } + if (other.hasAuthorizationPolicy()) { + mergeAuthorizationPolicy(other.getAuthorizationPolicy()); + } + 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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource of the AuthorizationPolicy. Must be in the
+     * format `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the AuthorizationPolicy. Must be in the
+     * format `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the AuthorizationPolicy. Must be in the
+     * format `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the AuthorizationPolicy. Must be in the
+     * format `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource of the AuthorizationPolicy. Must be in the
+     * format `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 java.lang.Object authorizationPolicyId_ = ""; + /** + * + * + *
+     * Required. Short name of the AuthorizationPolicy resource to be created.
+     * This value should be 1-63 characters long, containing only
+     * letters, numbers, hyphens, and underscores, and should not start
+     * with a number. E.g. "authz_policy".
+     * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The authorizationPolicyId. + */ + public java.lang.String getAuthorizationPolicyId() { + java.lang.Object ref = authorizationPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizationPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Short name of the AuthorizationPolicy resource to be created.
+     * This value should be 1-63 characters long, containing only
+     * letters, numbers, hyphens, and underscores, and should not start
+     * with a number. E.g. "authz_policy".
+     * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for authorizationPolicyId. + */ + public com.google.protobuf.ByteString getAuthorizationPolicyIdBytes() { + java.lang.Object ref = authorizationPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizationPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Short name of the AuthorizationPolicy resource to be created.
+     * This value should be 1-63 characters long, containing only
+     * letters, numbers, hyphens, and underscores, and should not start
+     * with a number. E.g. "authz_policy".
+     * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The authorizationPolicyId to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + authorizationPolicyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Short name of the AuthorizationPolicy resource to be created.
+     * This value should be 1-63 characters long, containing only
+     * letters, numbers, hyphens, and underscores, and should not start
+     * with a number. E.g. "authz_policy".
+     * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAuthorizationPolicyId() { + + authorizationPolicyId_ = getDefaultInstance().getAuthorizationPolicyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Short name of the AuthorizationPolicy resource to be created.
+     * This value should be 1-63 characters long, containing only
+     * letters, numbers, hyphens, and underscores, and should not start
+     * with a number. E.g. "authz_policy".
+     * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for authorizationPolicyId to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + authorizationPolicyId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networksecurity.v1.AuthorizationPolicy authorizationPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + authorizationPolicyBuilder_; + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizationPolicy field is set. + */ + public boolean hasAuthorizationPolicy() { + return authorizationPolicyBuilder_ != null || authorizationPolicy_ != null; + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizationPolicy. + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy() { + if (authorizationPolicyBuilder_ == null) { + return authorizationPolicy_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance() + : authorizationPolicy_; + } else { + return authorizationPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizationPolicy( + com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorizationPolicy_ = value; + onChanged(); + } else { + authorizationPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizationPolicy( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder builderForValue) { + if (authorizationPolicyBuilder_ == null) { + authorizationPolicy_ = builderForValue.build(); + onChanged(); + } else { + authorizationPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAuthorizationPolicy( + com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPolicyBuilder_ == null) { + if (authorizationPolicy_ != null) { + authorizationPolicy_ = + com.google.cloud.networksecurity.v1.AuthorizationPolicy.newBuilder( + authorizationPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + authorizationPolicy_ = value; + } + onChanged(); + } else { + authorizationPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAuthorizationPolicy() { + if (authorizationPolicyBuilder_ == null) { + authorizationPolicy_ = null; + onChanged(); + } else { + authorizationPolicy_ = null; + authorizationPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder + getAuthorizationPolicyBuilder() { + + onChanged(); + return getAuthorizationPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPolicyOrBuilder() { + if (authorizationPolicyBuilder_ != null) { + return authorizationPolicyBuilder_.getMessageOrBuilder(); + } else { + return authorizationPolicy_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance() + : authorizationPolicy_; + } + } + /** + * + * + *
+     * Required. AuthorizationPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + getAuthorizationPolicyFieldBuilder() { + if (authorizationPolicyBuilder_ == null) { + authorizationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder>( + getAuthorizationPolicy(), getParentForChildren(), isClean()); + authorizationPolicy_ = null; + } + return authorizationPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) + private static final com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAuthorizationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAuthorizationPolicyRequest(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.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequestOrBuilder.java new file mode 100644 index 00000000..f1b33cd9 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateAuthorizationPolicyRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface CreateAuthorizationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource of the AuthorizationPolicy. Must be in the
+   * format `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource of the AuthorizationPolicy. Must be in the
+   * format `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Short name of the AuthorizationPolicy resource to be created.
+   * This value should be 1-63 characters long, containing only
+   * letters, numbers, hyphens, and underscores, and should not start
+   * with a number. E.g. "authz_policy".
+   * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The authorizationPolicyId. + */ + java.lang.String getAuthorizationPolicyId(); + /** + * + * + *
+   * Required. Short name of the AuthorizationPolicy resource to be created.
+   * This value should be 1-63 characters long, containing only
+   * letters, numbers, hyphens, and underscores, and should not start
+   * with a number. E.g. "authz_policy".
+   * 
+ * + * string authorization_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for authorizationPolicyId. + */ + com.google.protobuf.ByteString getAuthorizationPolicyIdBytes(); + + /** + * + * + *
+   * Required. AuthorizationPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizationPolicy field is set. + */ + boolean hasAuthorizationPolicy(); + /** + * + * + *
+   * Required. AuthorizationPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizationPolicy. + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy(); + /** + * + * + *
+   * Required. AuthorizationPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequest.java new file mode 100644 index 00000000..5f353edd --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequest.java @@ -0,0 +1,1165 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the CreateClientTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} + */ +public final class CreateClientTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + CreateClientTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateClientTlsPolicyRequest.newBuilder() to construct. + private CreateClientTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateClientTlsPolicyRequest() { + parent_ = ""; + clientTlsPolicyId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateClientTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateClientTlsPolicyRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + clientTlsPolicyId_ = s; + break; + } + case 26: + { + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder subBuilder = null; + if (clientTlsPolicy_ != null) { + subBuilder = clientTlsPolicy_.toBuilder(); + } + clientTlsPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientTlsPolicy_); + clientTlsPolicy_ = 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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource of the ClientTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ClientTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 CLIENT_TLS_POLICY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientTlsPolicyId_; + /** + * + * + *
+   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clientTlsPolicyId. + */ + @java.lang.Override + public java.lang.String getClientTlsPolicyId() { + java.lang.Object ref = clientTlsPolicyId_; + 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(); + clientTlsPolicyId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clientTlsPolicyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientTlsPolicyIdBytes() { + java.lang.Object ref = clientTlsPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientTlsPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_TLS_POLICY_FIELD_NUMBER = 3; + private com.google.cloud.networksecurity.v1.ClientTlsPolicy clientTlsPolicy_; + /** + * + * + *
+   * Required. ClientTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientTlsPolicy field is set. + */ + @java.lang.Override + public boolean hasClientTlsPolicy() { + return clientTlsPolicy_ != null; + } + /** + * + * + *
+   * Required. ClientTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientTlsPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy() { + return clientTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance() + : clientTlsPolicy_; + } + /** + * + * + *
+   * Required. ClientTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder + getClientTlsPolicyOrBuilder() { + return getClientTlsPolicy(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientTlsPolicyId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientTlsPolicyId_); + } + if (clientTlsPolicy_ != null) { + output.writeMessage(3, getClientTlsPolicy()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientTlsPolicyId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientTlsPolicyId_); + } + if (clientTlsPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getClientTlsPolicy()); + } + 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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getClientTlsPolicyId().equals(other.getClientTlsPolicyId())) return false; + if (hasClientTlsPolicy() != other.hasClientTlsPolicy()) return false; + if (hasClientTlsPolicy()) { + if (!getClientTlsPolicy().equals(other.getClientTlsPolicy())) 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) + CLIENT_TLS_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientTlsPolicyId().hashCode(); + if (hasClientTlsPolicy()) { + hash = (37 * hash) + CLIENT_TLS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getClientTlsPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest 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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest 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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest 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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest 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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest 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 used by the CreateClientTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.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_ = ""; + + clientTlsPolicyId_ = ""; + + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicy_ = null; + } else { + clientTlsPolicy_ = null; + clientTlsPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest(this); + result.parent_ = parent_; + result.clientTlsPolicyId_ = clientTlsPolicyId_; + if (clientTlsPolicyBuilder_ == null) { + result.clientTlsPolicy_ = clientTlsPolicy_; + } else { + result.clientTlsPolicy_ = clientTlsPolicyBuilder_.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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getClientTlsPolicyId().isEmpty()) { + clientTlsPolicyId_ = other.clientTlsPolicyId_; + onChanged(); + } + if (other.hasClientTlsPolicy()) { + mergeClientTlsPolicy(other.getClientTlsPolicy()); + } + 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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource of the ClientTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ClientTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ClientTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ClientTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource of the ClientTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 java.lang.Object clientTlsPolicyId_ = ""; + /** + * + * + *
+     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clientTlsPolicyId. + */ + public java.lang.String getClientTlsPolicyId() { + java.lang.Object ref = clientTlsPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientTlsPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clientTlsPolicyId. + */ + public com.google.protobuf.ByteString getClientTlsPolicyIdBytes() { + java.lang.Object ref = clientTlsPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientTlsPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The clientTlsPolicyId to set. + * @return This builder for chaining. + */ + public Builder setClientTlsPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + clientTlsPolicyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearClientTlsPolicyId() { + + clientTlsPolicyId_ = getDefaultInstance().getClientTlsPolicyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for clientTlsPolicyId to set. + * @return This builder for chaining. + */ + public Builder setClientTlsPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + clientTlsPolicyId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networksecurity.v1.ClientTlsPolicy clientTlsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder> + clientTlsPolicyBuilder_; + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientTlsPolicy field is set. + */ + public boolean hasClientTlsPolicy() { + return clientTlsPolicyBuilder_ != null || clientTlsPolicy_ != null; + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientTlsPolicy. + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy() { + if (clientTlsPolicyBuilder_ == null) { + return clientTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance() + : clientTlsPolicy_; + } else { + return clientTlsPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setClientTlsPolicy(com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientTlsPolicy_ = value; + onChanged(); + } else { + clientTlsPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setClientTlsPolicy( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder builderForValue) { + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicy_ = builderForValue.build(); + onChanged(); + } else { + clientTlsPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeClientTlsPolicy(com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPolicyBuilder_ == null) { + if (clientTlsPolicy_ != null) { + clientTlsPolicy_ = + com.google.cloud.networksecurity.v1.ClientTlsPolicy.newBuilder(clientTlsPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + clientTlsPolicy_ = value; + } + onChanged(); + } else { + clientTlsPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearClientTlsPolicy() { + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicy_ = null; + onChanged(); + } else { + clientTlsPolicy_ = null; + clientTlsPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder getClientTlsPolicyBuilder() { + + onChanged(); + return getClientTlsPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder + getClientTlsPolicyOrBuilder() { + if (clientTlsPolicyBuilder_ != null) { + return clientTlsPolicyBuilder_.getMessageOrBuilder(); + } else { + return clientTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance() + : clientTlsPolicy_; + } + } + /** + * + * + *
+     * Required. ClientTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder> + getClientTlsPolicyFieldBuilder() { + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder>( + getClientTlsPolicy(), getParentForChildren(), isClean()); + clientTlsPolicy_ = null; + } + return clientTlsPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateClientTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateClientTlsPolicyRequest(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.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..00ae92f0 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateClientTlsPolicyRequestOrBuilder.java @@ -0,0 +1,126 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface CreateClientTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource of the ClientTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource of the ClientTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clientTlsPolicyId. + */ + java.lang.String getClientTlsPolicyId(); + /** + * + * + *
+   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * 
+ * + * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clientTlsPolicyId. + */ + com.google.protobuf.ByteString getClientTlsPolicyIdBytes(); + + /** + * + * + *
+   * Required. ClientTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientTlsPolicy field is set. + */ + boolean hasClientTlsPolicy(); + /** + * + * + *
+   * Required. ClientTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientTlsPolicy. + */ + com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy(); + /** + * + * + *
+   * Required. ClientTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder getClientTlsPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequest.java new file mode 100644 index 00000000..c95be1a2 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequest.java @@ -0,0 +1,1165 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the CreateServerTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} + */ +public final class CreateServerTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + CreateServerTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateServerTlsPolicyRequest.newBuilder() to construct. + private CreateServerTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateServerTlsPolicyRequest() { + parent_ = ""; + serverTlsPolicyId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateServerTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateServerTlsPolicyRequest( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + serverTlsPolicyId_ = s; + break; + } + case 26: + { + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder subBuilder = null; + if (serverTlsPolicy_ != null) { + subBuilder = serverTlsPolicy_.toBuilder(); + } + serverTlsPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serverTlsPolicy_); + serverTlsPolicy_ = 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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource of the ServerTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ServerTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 SERVER_TLS_POLICY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object serverTlsPolicyId_; + /** + * + * + *
+   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The serverTlsPolicyId. + */ + @java.lang.Override + public java.lang.String getServerTlsPolicyId() { + java.lang.Object ref = serverTlsPolicyId_; + 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(); + serverTlsPolicyId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for serverTlsPolicyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerTlsPolicyIdBytes() { + java.lang.Object ref = serverTlsPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverTlsPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_TLS_POLICY_FIELD_NUMBER = 3; + private com.google.cloud.networksecurity.v1.ServerTlsPolicy serverTlsPolicy_; + /** + * + * + *
+   * Required. ServerTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the serverTlsPolicy field is set. + */ + @java.lang.Override + public boolean hasServerTlsPolicy() { + return serverTlsPolicy_ != null; + } + /** + * + * + *
+   * Required. ServerTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serverTlsPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy() { + return serverTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance() + : serverTlsPolicy_; + } + /** + * + * + *
+   * Required. ServerTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder + getServerTlsPolicyOrBuilder() { + return getServerTlsPolicy(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverTlsPolicyId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serverTlsPolicyId_); + } + if (serverTlsPolicy_ != null) { + output.writeMessage(3, getServerTlsPolicy()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverTlsPolicyId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serverTlsPolicyId_); + } + if (serverTlsPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getServerTlsPolicy()); + } + 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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getServerTlsPolicyId().equals(other.getServerTlsPolicyId())) return false; + if (hasServerTlsPolicy() != other.hasServerTlsPolicy()) return false; + if (hasServerTlsPolicy()) { + if (!getServerTlsPolicy().equals(other.getServerTlsPolicy())) 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) + SERVER_TLS_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getServerTlsPolicyId().hashCode(); + if (hasServerTlsPolicy()) { + hash = (37 * hash) + SERVER_TLS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getServerTlsPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest 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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest 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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest 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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest 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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest 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 used by the CreateServerTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.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_ = ""; + + serverTlsPolicyId_ = ""; + + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicy_ = null; + } else { + serverTlsPolicy_ = null; + serverTlsPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest(this); + result.parent_ = parent_; + result.serverTlsPolicyId_ = serverTlsPolicyId_; + if (serverTlsPolicyBuilder_ == null) { + result.serverTlsPolicy_ = serverTlsPolicy_; + } else { + result.serverTlsPolicy_ = serverTlsPolicyBuilder_.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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getServerTlsPolicyId().isEmpty()) { + serverTlsPolicyId_ = other.serverTlsPolicyId_; + onChanged(); + } + if (other.hasServerTlsPolicy()) { + mergeServerTlsPolicy(other.getServerTlsPolicy()); + } + 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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource of the ServerTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ServerTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ServerTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 parent resource of the ServerTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource of the ServerTlsPolicy. Must be in
+     * the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 java.lang.Object serverTlsPolicyId_ = ""; + /** + * + * + *
+     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The serverTlsPolicyId. + */ + public java.lang.String getServerTlsPolicyId() { + java.lang.Object ref = serverTlsPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverTlsPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for serverTlsPolicyId. + */ + public com.google.protobuf.ByteString getServerTlsPolicyIdBytes() { + java.lang.Object ref = serverTlsPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverTlsPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The serverTlsPolicyId to set. + * @return This builder for chaining. + */ + public Builder setServerTlsPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serverTlsPolicyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearServerTlsPolicyId() { + + serverTlsPolicyId_ = getDefaultInstance().getServerTlsPolicyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+     * be 1-63 characters long, containing only letters, numbers, hyphens, and
+     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for serverTlsPolicyId to set. + * @return This builder for chaining. + */ + public Builder setServerTlsPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serverTlsPolicyId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networksecurity.v1.ServerTlsPolicy serverTlsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder> + serverTlsPolicyBuilder_; + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the serverTlsPolicy field is set. + */ + public boolean hasServerTlsPolicy() { + return serverTlsPolicyBuilder_ != null || serverTlsPolicy_ != null; + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serverTlsPolicy. + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy() { + if (serverTlsPolicyBuilder_ == null) { + return serverTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance() + : serverTlsPolicy_; + } else { + return serverTlsPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServerTlsPolicy(com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverTlsPolicy_ = value; + onChanged(); + } else { + serverTlsPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServerTlsPolicy( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder builderForValue) { + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicy_ = builderForValue.build(); + onChanged(); + } else { + serverTlsPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeServerTlsPolicy(com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPolicyBuilder_ == null) { + if (serverTlsPolicy_ != null) { + serverTlsPolicy_ = + com.google.cloud.networksecurity.v1.ServerTlsPolicy.newBuilder(serverTlsPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + serverTlsPolicy_ = value; + } + onChanged(); + } else { + serverTlsPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearServerTlsPolicy() { + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicy_ = null; + onChanged(); + } else { + serverTlsPolicy_ = null; + serverTlsPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder getServerTlsPolicyBuilder() { + + onChanged(); + return getServerTlsPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder + getServerTlsPolicyOrBuilder() { + if (serverTlsPolicyBuilder_ != null) { + return serverTlsPolicyBuilder_.getMessageOrBuilder(); + } else { + return serverTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance() + : serverTlsPolicy_; + } + } + /** + * + * + *
+     * Required. ServerTlsPolicy resource to be created.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder> + getServerTlsPolicyFieldBuilder() { + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder>( + getServerTlsPolicy(), getParentForChildren(), isClean()); + serverTlsPolicy_ = null; + } + return serverTlsPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateServerTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateServerTlsPolicyRequest(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.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..c052b6e4 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/CreateServerTlsPolicyRequestOrBuilder.java @@ -0,0 +1,126 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface CreateServerTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource of the ServerTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource of the ServerTlsPolicy. Must be in
+   * the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The serverTlsPolicyId. + */ + java.lang.String getServerTlsPolicyId(); + /** + * + * + *
+   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
+   * be 1-63 characters long, containing only letters, numbers, hyphens, and
+   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * 
+ * + * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for serverTlsPolicyId. + */ + com.google.protobuf.ByteString getServerTlsPolicyIdBytes(); + + /** + * + * + *
+   * Required. ServerTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the serverTlsPolicy field is set. + */ + boolean hasServerTlsPolicy(); + /** + * + * + *
+   * Required. ServerTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serverTlsPolicy. + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy(); + /** + * + * + *
+   * Required. ServerTlsPolicy resource to be created.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder getServerTlsPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequest.java new file mode 100644 index 00000000..61c8eedc --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequest.java @@ -0,0 +1,672 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the DeleteAuthorizationPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest} + */ +public final class DeleteAuthorizationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) + DeleteAuthorizationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAuthorizationPolicyRequest.newBuilder() to construct. + private DeleteAuthorizationPolicyRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAuthorizationPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAuthorizationPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAuthorizationPolicyRequest( + 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to delete. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest other = + (com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) 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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest 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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest 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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + 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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest 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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest 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 used by the DeleteAuthorizationPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest.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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest build() { + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest result = + new com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest(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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + .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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to delete. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to delete. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to delete. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) + private static final com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAuthorizationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAuthorizationPolicyRequest(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.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequestOrBuilder.java new file mode 100644 index 00000000..a062a361 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteAuthorizationPolicyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface DeleteAuthorizationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequest.java new file mode 100644 index 00000000..890ab458 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequest.java @@ -0,0 +1,667 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the DeleteClientTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} + */ +public final class DeleteClientTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + DeleteClientTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteClientTlsPolicyRequest.newBuilder() to construct. + private DeleteClientTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteClientTlsPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClientTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteClientTlsPolicyRequest( + 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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A name of the ClientTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) 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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest 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 used by the DeleteClientTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest(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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the ClientTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the ClientTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteClientTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteClientTlsPolicyRequest(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.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..a06bb173 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteClientTlsPolicyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface DeleteClientTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the ClientTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the ClientTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequest.java new file mode 100644 index 00000000..04a27ec1 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequest.java @@ -0,0 +1,667 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the DeleteServerTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} + */ +public final class DeleteServerTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + DeleteServerTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteServerTlsPolicyRequest.newBuilder() to construct. + private DeleteServerTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteServerTlsPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteServerTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteServerTlsPolicyRequest( + 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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A name of the ServerTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) 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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest 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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest 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 used by the DeleteServerTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest(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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the ServerTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the ServerTlsPolicy to delete. Must be in
+     * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteServerTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteServerTlsPolicyRequest(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.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..c88a2557 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/DeleteServerTlsPolicyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface DeleteServerTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the ServerTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the ServerTlsPolicy to delete. Must be in
+   * the format `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequest.java new file mode 100644 index 00000000..3cd2d4c5 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequest.java @@ -0,0 +1,669 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the GetAuthorizationPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest} + */ +public final class GetAuthorizationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) + GetAuthorizationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAuthorizationPolicyRequest.newBuilder() to construct. + private GetAuthorizationPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAuthorizationPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAuthorizationPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAuthorizationPolicyRequest( + 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A name of the AuthorizationPolicy to get. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to get. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest other = + (com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) 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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest 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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest 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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + 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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest 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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest 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 used by the GetAuthorizationPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest build() { + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest result = + new com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest(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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest.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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the AuthorizationPolicy to get. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to get. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to get. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the AuthorizationPolicy to get. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the AuthorizationPolicy to get. Must be in the format
+     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) + private static final com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAuthorizationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAuthorizationPolicyRequest(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.cloud.networksecurity.v1.GetAuthorizationPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequestOrBuilder.java new file mode 100644 index 00000000..44b182db --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetAuthorizationPolicyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface GetAuthorizationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the AuthorizationPolicy to get. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the AuthorizationPolicy to get. Must be in the format
+   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequest.java new file mode 100644 index 00000000..2687c1ab --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequest.java @@ -0,0 +1,664 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the GetClientTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} + */ +public final class GetClientTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + GetClientTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetClientTlsPolicyRequest.newBuilder() to construct. + private GetClientTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetClientTlsPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetClientTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetClientTlsPolicyRequest( + 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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A name of the ClientTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.GetClientTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) 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.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest 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.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest 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.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest 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.cloud.networksecurity.v1.GetClientTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest 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.cloud.networksecurity.v1.GetClientTlsPolicyRequest 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 used by the GetClientTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest(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.cloud.networksecurity.v1.GetClientTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.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.cloud.networksecurity.v1.GetClientTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the ClientTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ClientTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the ClientTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/clientTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClientTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetClientTlsPolicyRequest(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.cloud.networksecurity.v1.GetClientTlsPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..bfdec696 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetClientTlsPolicyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface GetClientTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the ClientTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the ClientTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/clientTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequest.java new file mode 100644 index 00000000..572501dc --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequest.java @@ -0,0 +1,664 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the GetServerTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} + */ +public final class GetServerTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + GetServerTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetServerTlsPolicyRequest.newBuilder() to construct. + private GetServerTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetServerTlsPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetServerTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetServerTlsPolicyRequest( + 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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A name of the ServerTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.GetServerTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) 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.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest 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.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest 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.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest 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.cloud.networksecurity.v1.GetServerTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest 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.cloud.networksecurity.v1.GetServerTlsPolicyRequest 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 used by the GetServerTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest(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.cloud.networksecurity.v1.GetServerTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.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.cloud.networksecurity.v1.GetServerTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the ServerTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. A name of the ServerTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the ServerTlsPolicy to get. Must be in the format
+     * `projects/*/locations/{location}/serverTlsPolicies/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetServerTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetServerTlsPolicyRequest(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.cloud.networksecurity.v1.GetServerTlsPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..26a41eba --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GetServerTlsPolicyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface GetServerTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the ServerTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the ServerTlsPolicy to get. Must be in the format
+   * `projects/*/locations/{location}/serverTlsPolicies/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpoint.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpoint.java new file mode 100644 index 00000000..6b60c6ca --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpoint.java @@ -0,0 +1,644 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Specification of the GRPC Endpoint.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GrpcEndpoint} + */ +public final class GrpcEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.GrpcEndpoint) + GrpcEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use GrpcEndpoint.newBuilder() to construct. + private GrpcEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GrpcEndpoint() { + targetUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GrpcEndpoint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GrpcEndpoint( + 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(); + + targetUri_ = 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.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GrpcEndpoint.class, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder.class); + } + + public static final int TARGET_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object targetUri_; + /** + * + * + *
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+   * should start with "unix:".
+   * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetUri. + */ + @java.lang.Override + public java.lang.String getTargetUri() { + java.lang.Object ref = targetUri_; + 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(); + targetUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+   * should start with "unix:".
+   * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetUriBytes() { + java.lang.Object ref = targetUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetUri_ = 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(targetUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, targetUri_); + } + 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(targetUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, targetUri_); + } + 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.cloud.networksecurity.v1.GrpcEndpoint)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.GrpcEndpoint other = + (com.google.cloud.networksecurity.v1.GrpcEndpoint) obj; + + if (!getTargetUri().equals(other.getTargetUri())) 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) + TARGET_URI_FIELD_NUMBER; + hash = (53 * hash) + getTargetUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint 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.cloud.networksecurity.v1.GrpcEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint 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.cloud.networksecurity.v1.GrpcEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint 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.cloud.networksecurity.v1.GrpcEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint 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.cloud.networksecurity.v1.GrpcEndpoint 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; + } + /** + * + * + *
+   * Specification of the GRPC Endpoint.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.GrpcEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.GrpcEndpoint) + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.GrpcEndpoint.class, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.GrpcEndpoint.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(); + targetUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint build() { + com.google.cloud.networksecurity.v1.GrpcEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint buildPartial() { + com.google.cloud.networksecurity.v1.GrpcEndpoint result = + new com.google.cloud.networksecurity.v1.GrpcEndpoint(this); + result.targetUri_ = targetUri_; + 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.cloud.networksecurity.v1.GrpcEndpoint) { + return mergeFrom((com.google.cloud.networksecurity.v1.GrpcEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.GrpcEndpoint other) { + if (other == com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance()) + return this; + if (!other.getTargetUri().isEmpty()) { + targetUri_ = other.targetUri_; + 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.cloud.networksecurity.v1.GrpcEndpoint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.networksecurity.v1.GrpcEndpoint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object targetUri_ = ""; + /** + * + * + *
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+     * should start with "unix:".
+     * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetUri. + */ + public java.lang.String getTargetUri() { + java.lang.Object ref = targetUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+     * should start with "unix:".
+     * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetUri. + */ + public com.google.protobuf.ByteString getTargetUriBytes() { + java.lang.Object ref = targetUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+     * should start with "unix:".
+     * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The targetUri to set. + * @return This builder for chaining. + */ + public Builder setTargetUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+     * should start with "unix:".
+     * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTargetUri() { + + targetUri_ = getDefaultInstance().getTargetUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+     * should start with "unix:".
+     * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for targetUri to set. + * @return This builder for chaining. + */ + public Builder setTargetUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetUri_ = 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.cloud.networksecurity.v1.GrpcEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.GrpcEndpoint) + private static final com.google.cloud.networksecurity.v1.GrpcEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.GrpcEndpoint(); + } + + public static com.google.cloud.networksecurity.v1.GrpcEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GrpcEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GrpcEndpoint(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.cloud.networksecurity.v1.GrpcEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpointOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpointOrBuilder.java new file mode 100644 index 00000000..e8bf20fe --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/GrpcEndpointOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +public interface GrpcEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.GrpcEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+   * should start with "unix:".
+   * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetUri. + */ + java.lang.String getTargetUri(); + /** + * + * + *
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
+   * should start with "unix:".
+   * 
+ * + * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetUri. + */ + com.google.protobuf.ByteString getTargetUriBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequest.java new file mode 100644 index 00000000..e291fa07 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequest.java @@ -0,0 +1,969 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used with the ListAuthorizationPolicies method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest} + */ +public final class ListAuthorizationPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) + ListAuthorizationPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAuthorizationPoliciesRequest.newBuilder() to construct. + private ListAuthorizationPoliciesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAuthorizationPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAuthorizationPoliciesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAuthorizationPoliciesRequest( + 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest.class, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the AuthorizationPolicies
+   * should be listed, specified in the format
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the AuthorizationPolicies
+   * should be listed, specified in the format
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+   * Maximum number of AuthorizationPolicies to return per call.
+   * 
+ * + * 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_; + /** + * + * + *
+   * The value returned by the last
+   * `ListAuthorizationPoliciesResponse` Indicates that this is a
+   * continuation of a prior `ListAuthorizationPolicies` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The value returned by the last
+   * `ListAuthorizationPoliciesResponse` Indicates that this is a
+   * continuation of a prior `ListAuthorizationPolicies` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest other = + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest 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 used with the ListAuthorizationPolicies method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest.class, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest.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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest build() { + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest buildPartial() { + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest result = + new com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest(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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest other) { + if (other + == com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + .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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the AuthorizationPolicies
+     * should be listed, specified in the format
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the AuthorizationPolicies
+     * should be listed, specified in the format
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the AuthorizationPolicies
+     * should be listed, specified in the format
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the AuthorizationPolicies
+     * should be listed, specified in the format
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the AuthorizationPolicies
+     * should be listed, specified in the format
+     * `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * Maximum number of AuthorizationPolicies to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of AuthorizationPolicies to return per call.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Maximum number of AuthorizationPolicies to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last
+     * `ListAuthorizationPoliciesResponse` Indicates that this is a
+     * continuation of a prior `ListAuthorizationPolicies` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListAuthorizationPoliciesResponse` Indicates that this is a
+     * continuation of a prior `ListAuthorizationPolicies` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListAuthorizationPoliciesResponse` Indicates that this is a
+     * continuation of a prior `ListAuthorizationPolicies` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListAuthorizationPoliciesResponse` Indicates that this is a
+     * continuation of a prior `ListAuthorizationPolicies` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListAuthorizationPoliciesResponse` Indicates that this is a
+     * continuation of a prior `ListAuthorizationPolicies` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * 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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) + private static final com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest(); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAuthorizationPoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAuthorizationPoliciesRequest(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.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequestOrBuilder.java new file mode 100644 index 00000000..01979f77 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ListAuthorizationPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the AuthorizationPolicies
+   * should be listed, specified in the format
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the AuthorizationPolicies
+   * should be listed, specified in the format
+   * `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of AuthorizationPolicies to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last
+   * `ListAuthorizationPoliciesResponse` Indicates that this is a
+   * continuation of a prior `ListAuthorizationPolicies` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last
+   * `ListAuthorizationPoliciesResponse` Indicates that this is a
+   * continuation of a prior `ListAuthorizationPolicies` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponse.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponse.java new file mode 100644 index 00000000..a52da94c --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponse.java @@ -0,0 +1,1227 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Response returned by the ListAuthorizationPolicies method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse} + */ +public final class ListAuthorizationPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) + ListAuthorizationPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAuthorizationPoliciesResponse.newBuilder() to construct. + private ListAuthorizationPoliciesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAuthorizationPoliciesResponse() { + authorizationPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAuthorizationPoliciesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAuthorizationPoliciesResponse( + 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)) { + authorizationPolicies_ = + new java.util.ArrayList< + com.google.cloud.networksecurity.v1.AuthorizationPolicy>(); + mutable_bitField0_ |= 0x00000001; + } + authorizationPolicies_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.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)) { + authorizationPolicies_ = java.util.Collections.unmodifiableList(authorizationPolicies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse.class, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse.Builder.class); + } + + public static final int AUTHORIZATION_POLICIES_FIELD_NUMBER = 1; + private java.util.List + authorizationPolicies_; + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + @java.lang.Override + public java.util.List + getAuthorizationPoliciesList() { + return authorizationPolicies_; + } + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + @java.lang.Override + public java.util.List + getAuthorizationPoliciesOrBuilderList() { + return authorizationPolicies_; + } + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + @java.lang.Override + public int getAuthorizationPoliciesCount() { + return authorizationPolicies_.size(); + } + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicies( + int index) { + return authorizationPolicies_.get(index); + } + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPoliciesOrBuilder(int index) { + return authorizationPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * 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 < authorizationPolicies_.size(); i++) { + output.writeMessage(1, authorizationPolicies_.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 < authorizationPolicies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, authorizationPolicies_.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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse other = + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) obj; + + if (!getAuthorizationPoliciesList().equals(other.getAuthorizationPoliciesList())) 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 (getAuthorizationPoliciesCount() > 0) { + hash = (37 * hash) + AUTHORIZATION_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationPoliciesList().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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse 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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse 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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + 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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse 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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse 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 returned by the ListAuthorizationPolicies method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse.class, + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAuthorizationPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (authorizationPoliciesBuilder_ == null) { + authorizationPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + authorizationPoliciesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListAuthorizationPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse build() { + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse buildPartial() { + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse result = + new com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse(this); + int from_bitField0_ = bitField0_; + if (authorizationPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + authorizationPolicies_ = java.util.Collections.unmodifiableList(authorizationPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.authorizationPolicies_ = authorizationPolicies_; + } else { + result.authorizationPolicies_ = authorizationPoliciesBuilder_.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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse other) { + if (other + == com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + .getDefaultInstance()) return this; + if (authorizationPoliciesBuilder_ == null) { + if (!other.authorizationPolicies_.isEmpty()) { + if (authorizationPolicies_.isEmpty()) { + authorizationPolicies_ = other.authorizationPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.addAll(other.authorizationPolicies_); + } + onChanged(); + } + } else { + if (!other.authorizationPolicies_.isEmpty()) { + if (authorizationPoliciesBuilder_.isEmpty()) { + authorizationPoliciesBuilder_.dispose(); + authorizationPoliciesBuilder_ = null; + authorizationPolicies_ = other.authorizationPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + authorizationPoliciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAuthorizationPoliciesFieldBuilder() + : null; + } else { + authorizationPoliciesBuilder_.addAllMessages(other.authorizationPolicies_); + } + } + } + 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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + authorizationPolicies_ = java.util.Collections.emptyList(); + + private void ensureAuthorizationPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + authorizationPolicies_ = + new java.util.ArrayList( + authorizationPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + authorizationPoliciesBuilder_; + + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public java.util.List + getAuthorizationPoliciesList() { + if (authorizationPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(authorizationPolicies_); + } else { + return authorizationPoliciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public int getAuthorizationPoliciesCount() { + if (authorizationPoliciesBuilder_ == null) { + return authorizationPolicies_.size(); + } else { + return authorizationPoliciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicies( + int index) { + if (authorizationPoliciesBuilder_ == null) { + return authorizationPolicies_.get(index); + } else { + return authorizationPoliciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder setAuthorizationPolicies( + int index, com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.set(index, value); + onChanged(); + } else { + authorizationPoliciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder setAuthorizationPolicies( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder builderForValue) { + if (authorizationPoliciesBuilder_ == null) { + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + authorizationPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder addAuthorizationPolicies( + com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.add(value); + onChanged(); + } else { + authorizationPoliciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder addAuthorizationPolicies( + int index, com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.add(index, value); + onChanged(); + } else { + authorizationPoliciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder addAuthorizationPolicies( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder builderForValue) { + if (authorizationPoliciesBuilder_ == null) { + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.add(builderForValue.build()); + onChanged(); + } else { + authorizationPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder addAuthorizationPolicies( + int index, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder builderForValue) { + if (authorizationPoliciesBuilder_ == null) { + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + authorizationPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder addAllAuthorizationPolicies( + java.lang.Iterable + values) { + if (authorizationPoliciesBuilder_ == null) { + ensureAuthorizationPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, authorizationPolicies_); + onChanged(); + } else { + authorizationPoliciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder clearAuthorizationPolicies() { + if (authorizationPoliciesBuilder_ == null) { + authorizationPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + authorizationPoliciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public Builder removeAuthorizationPolicies(int index) { + if (authorizationPoliciesBuilder_ == null) { + ensureAuthorizationPoliciesIsMutable(); + authorizationPolicies_.remove(index); + onChanged(); + } else { + authorizationPoliciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder + getAuthorizationPoliciesBuilder(int index) { + return getAuthorizationPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPoliciesOrBuilder(int index) { + if (authorizationPoliciesBuilder_ == null) { + return authorizationPolicies_.get(index); + } else { + return authorizationPoliciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + getAuthorizationPoliciesOrBuilderList() { + if (authorizationPoliciesBuilder_ != null) { + return authorizationPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(authorizationPolicies_); + } + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder + addAuthorizationPoliciesBuilder() { + return getAuthorizationPoliciesFieldBuilder() + .addBuilder(com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder + addAuthorizationPoliciesBuilder(int index) { + return getAuthorizationPoliciesFieldBuilder() + .addBuilder( + index, com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * List of AuthorizationPolicies resources.
+     * 
+ * + * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + public java.util.List + getAuthorizationPoliciesBuilderList() { + return getAuthorizationPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + getAuthorizationPoliciesFieldBuilder() { + if (authorizationPoliciesBuilder_ == null) { + authorizationPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder>( + authorizationPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + authorizationPolicies_ = null; + } + return authorizationPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) + private static final com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse(); + } + + public static com.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAuthorizationPoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAuthorizationPoliciesResponse(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.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponseOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponseOrBuilder.java new file mode 100644 index 00000000..eb3926a8 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListAuthorizationPoliciesResponseOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ListAuthorizationPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + java.util.List + getAuthorizationPoliciesList(); + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicies(int index); + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + int getAuthorizationPoliciesCount(); + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + java.util.List + getAuthorizationPoliciesOrBuilderList(); + /** + * + * + *
+   * List of AuthorizationPolicies resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policies = 1; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPoliciesOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequest.java new file mode 100644 index 00000000..0864b1ed --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequest.java @@ -0,0 +1,957 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the ListClientTlsPolicies method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} + */ +public final class ListClientTlsPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + ListClientTlsPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClientTlsPoliciesRequest.newBuilder() to construct. + private ListClientTlsPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClientTlsPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClientTlsPoliciesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListClientTlsPoliciesRequest( + 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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.class, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the ClientTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ClientTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+   * Maximum number of ClientTlsPolicies to return per call.
+   * 
+ * + * 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_; + /** + * + * + *
+   * The value returned by the last `ListClientTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListClientTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The value returned by the last `ListClientTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListClientTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest other = + (com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest 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 used by the ListClientTlsPolicies method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.class, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest build() { + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest buildPartial() { + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest result = + new com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest(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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest other) { + if (other + == com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the ClientTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ClientTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ClientTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ClientTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the ClientTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * Maximum number of ClientTlsPolicies to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of ClientTlsPolicies to return per call.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Maximum number of ClientTlsPolicies to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListClientTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListClientTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The value returned by the last `ListClientTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListClientTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The value returned by the last `ListClientTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListClientTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The value returned by the last `ListClientTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListClientTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListClientTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListClientTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + private static final com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest(); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClientTlsPoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListClientTlsPoliciesRequest(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.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequestOrBuilder.java new file mode 100644 index 00000000..f880f4db --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ListClientTlsPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the ClientTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the ClientTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of ClientTlsPolicies to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last `ListClientTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListClientTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListClientTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListClientTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponse.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponse.java new file mode 100644 index 00000000..5e9125fb --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponse.java @@ -0,0 +1,1191 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Response returned by the ListClientTlsPolicies method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} + */ +public final class ListClientTlsPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + ListClientTlsPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListClientTlsPoliciesResponse.newBuilder() to construct. + private ListClientTlsPoliciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListClientTlsPoliciesResponse() { + clientTlsPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClientTlsPoliciesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListClientTlsPoliciesResponse( + 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)) { + clientTlsPolicies_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + clientTlsPolicies_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.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)) { + clientTlsPolicies_ = java.util.Collections.unmodifiableList(clientTlsPolicies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.class, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.Builder.class); + } + + public static final int CLIENT_TLS_POLICIES_FIELD_NUMBER = 1; + private java.util.List clientTlsPolicies_; + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + @java.lang.Override + public java.util.List + getClientTlsPoliciesList() { + return clientTlsPolicies_; + } + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + @java.lang.Override + public java.util.List + getClientTlsPoliciesOrBuilderList() { + return clientTlsPolicies_; + } + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + @java.lang.Override + public int getClientTlsPoliciesCount() { + return clientTlsPolicies_.size(); + } + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicies(int index) { + return clientTlsPolicies_.get(index); + } + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder getClientTlsPoliciesOrBuilder( + int index) { + return clientTlsPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * 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 < clientTlsPolicies_.size(); i++) { + output.writeMessage(1, clientTlsPolicies_.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 < clientTlsPolicies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, clientTlsPolicies_.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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse other = + (com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) obj; + + if (!getClientTlsPoliciesList().equals(other.getClientTlsPoliciesList())) 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 (getClientTlsPoliciesCount() > 0) { + hash = (37 * hash) + CLIENT_TLS_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getClientTlsPoliciesList().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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse 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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse 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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + 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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse 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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse 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 returned by the ListClientTlsPolicies method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.class, + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClientTlsPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (clientTlsPoliciesBuilder_ == null) { + clientTlsPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + clientTlsPoliciesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListClientTlsPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse build() { + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse buildPartial() { + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse result = + new com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse(this); + int from_bitField0_ = bitField0_; + if (clientTlsPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clientTlsPolicies_ = java.util.Collections.unmodifiableList(clientTlsPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clientTlsPolicies_ = clientTlsPolicies_; + } else { + result.clientTlsPolicies_ = clientTlsPoliciesBuilder_.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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) { + return mergeFrom((com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse other) { + if (other + == com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.getDefaultInstance()) + return this; + if (clientTlsPoliciesBuilder_ == null) { + if (!other.clientTlsPolicies_.isEmpty()) { + if (clientTlsPolicies_.isEmpty()) { + clientTlsPolicies_ = other.clientTlsPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.addAll(other.clientTlsPolicies_); + } + onChanged(); + } + } else { + if (!other.clientTlsPolicies_.isEmpty()) { + if (clientTlsPoliciesBuilder_.isEmpty()) { + clientTlsPoliciesBuilder_.dispose(); + clientTlsPoliciesBuilder_ = null; + clientTlsPolicies_ = other.clientTlsPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + clientTlsPoliciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClientTlsPoliciesFieldBuilder() + : null; + } else { + clientTlsPoliciesBuilder_.addAllMessages(other.clientTlsPolicies_); + } + } + } + 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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List clientTlsPolicies_ = + java.util.Collections.emptyList(); + + private void ensureClientTlsPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clientTlsPolicies_ = + new java.util.ArrayList( + clientTlsPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder> + clientTlsPoliciesBuilder_; + + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public java.util.List + getClientTlsPoliciesList() { + if (clientTlsPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(clientTlsPolicies_); + } else { + return clientTlsPoliciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public int getClientTlsPoliciesCount() { + if (clientTlsPoliciesBuilder_ == null) { + return clientTlsPolicies_.size(); + } else { + return clientTlsPoliciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicies(int index) { + if (clientTlsPoliciesBuilder_ == null) { + return clientTlsPolicies_.get(index); + } else { + return clientTlsPoliciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder setClientTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.set(index, value); + onChanged(); + } else { + clientTlsPoliciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder setClientTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder builderForValue) { + if (clientTlsPoliciesBuilder_ == null) { + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + clientTlsPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder addClientTlsPolicies(com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.add(value); + onChanged(); + } else { + clientTlsPoliciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder addClientTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.add(index, value); + onChanged(); + } else { + clientTlsPoliciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder addClientTlsPolicies( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder builderForValue) { + if (clientTlsPoliciesBuilder_ == null) { + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.add(builderForValue.build()); + onChanged(); + } else { + clientTlsPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder addClientTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder builderForValue) { + if (clientTlsPoliciesBuilder_ == null) { + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + clientTlsPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder addAllClientTlsPolicies( + java.lang.Iterable values) { + if (clientTlsPoliciesBuilder_ == null) { + ensureClientTlsPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clientTlsPolicies_); + onChanged(); + } else { + clientTlsPoliciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder clearClientTlsPolicies() { + if (clientTlsPoliciesBuilder_ == null) { + clientTlsPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clientTlsPoliciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public Builder removeClientTlsPolicies(int index) { + if (clientTlsPoliciesBuilder_ == null) { + ensureClientTlsPoliciesIsMutable(); + clientTlsPolicies_.remove(index); + onChanged(); + } else { + clientTlsPoliciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder getClientTlsPoliciesBuilder( + int index) { + return getClientTlsPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder + getClientTlsPoliciesOrBuilder(int index) { + if (clientTlsPoliciesBuilder_ == null) { + return clientTlsPolicies_.get(index); + } else { + return clientTlsPoliciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public java.util.List + getClientTlsPoliciesOrBuilderList() { + if (clientTlsPoliciesBuilder_ != null) { + return clientTlsPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clientTlsPolicies_); + } + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder + addClientTlsPoliciesBuilder() { + return getClientTlsPoliciesFieldBuilder() + .addBuilder(com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder addClientTlsPoliciesBuilder( + int index) { + return getClientTlsPoliciesFieldBuilder() + .addBuilder( + index, com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * List of ClientTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + * + */ + public java.util.List + getClientTlsPoliciesBuilderList() { + return getClientTlsPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder> + getClientTlsPoliciesFieldBuilder() { + if (clientTlsPoliciesBuilder_ == null) { + clientTlsPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder>( + clientTlsPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + clientTlsPolicies_ = null; + } + return clientTlsPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + private static final com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse(); + } + + public static com.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListClientTlsPoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListClientTlsPoliciesResponse(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.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponseOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponseOrBuilder.java new file mode 100644 index 00000000..d72ad348 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListClientTlsPoliciesResponseOrBuilder.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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ListClientTlsPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + java.util.List getClientTlsPoliciesList(); + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicies(int index); + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + int getClientTlsPoliciesCount(); + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + java.util.List + getClientTlsPoliciesOrBuilderList(); + /** + * + * + *
+   * List of ClientTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policies = 1; + */ + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder getClientTlsPoliciesOrBuilder( + int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequest.java new file mode 100644 index 00000000..6a908414 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequest.java @@ -0,0 +1,957 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the ListServerTlsPolicies method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} + */ +public final class ListServerTlsPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + ListServerTlsPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServerTlsPoliciesRequest.newBuilder() to construct. + private ListServerTlsPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServerTlsPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServerTlsPoliciesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServerTlsPoliciesRequest( + 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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.class, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the ServerTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ServerTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+   * Maximum number of ServerTlsPolicies to return per call.
+   * 
+ * + * 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_; + /** + * + * + *
+   * The value returned by the last `ListServerTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListServerTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The value returned by the last `ListServerTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListServerTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest other = + (com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest 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 used by the ListServerTlsPolicies method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.class, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest build() { + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest buildPartial() { + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest result = + new com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest(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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest other) { + if (other + == com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the ServerTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ServerTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ServerTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 project and location from which the ServerTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the ServerTlsPolicies should
+     * be listed, specified in the format `projects/*/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * Maximum number of ServerTlsPolicies to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of ServerTlsPolicies to return per call.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Maximum number of ServerTlsPolicies to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListServerTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListServerTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The value returned by the last `ListServerTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListServerTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The value returned by the last `ListServerTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListServerTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The value returned by the last `ListServerTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListServerTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListServerTlsPoliciesResponse`
+     * Indicates that this is a continuation of a prior
+     * `ListServerTlsPolicies` call, and that the system
+     * should return the next page of data.
+     * 
+ * + * 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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + private static final com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest(); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServerTlsPoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServerTlsPoliciesRequest(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.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequestOrBuilder.java new file mode 100644 index 00000000..8558be24 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ListServerTlsPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the ServerTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the ServerTlsPolicies should
+   * be listed, specified in the format `projects/*/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of ServerTlsPolicies to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last `ListServerTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListServerTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListServerTlsPoliciesResponse`
+   * Indicates that this is a continuation of a prior
+   * `ListServerTlsPolicies` call, and that the system
+   * should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponse.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponse.java new file mode 100644 index 00000000..318d90ab --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponse.java @@ -0,0 +1,1191 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Response returned by the ListServerTlsPolicies method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} + */ +public final class ListServerTlsPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + ListServerTlsPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServerTlsPoliciesResponse.newBuilder() to construct. + private ListServerTlsPoliciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServerTlsPoliciesResponse() { + serverTlsPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServerTlsPoliciesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServerTlsPoliciesResponse( + 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)) { + serverTlsPolicies_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serverTlsPolicies_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.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)) { + serverTlsPolicies_ = java.util.Collections.unmodifiableList(serverTlsPolicies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.class, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.Builder.class); + } + + public static final int SERVER_TLS_POLICIES_FIELD_NUMBER = 1; + private java.util.List serverTlsPolicies_; + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + @java.lang.Override + public java.util.List + getServerTlsPoliciesList() { + return serverTlsPolicies_; + } + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + @java.lang.Override + public java.util.List + getServerTlsPoliciesOrBuilderList() { + return serverTlsPolicies_; + } + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + @java.lang.Override + public int getServerTlsPoliciesCount() { + return serverTlsPolicies_.size(); + } + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicies(int index) { + return serverTlsPolicies_.get(index); + } + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder getServerTlsPoliciesOrBuilder( + int index) { + return serverTlsPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * 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 < serverTlsPolicies_.size(); i++) { + output.writeMessage(1, serverTlsPolicies_.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 < serverTlsPolicies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, serverTlsPolicies_.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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse other = + (com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) obj; + + if (!getServerTlsPoliciesList().equals(other.getServerTlsPoliciesList())) 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 (getServerTlsPoliciesCount() > 0) { + hash = (37 * hash) + SERVER_TLS_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getServerTlsPoliciesList().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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse 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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse 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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + 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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse 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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse 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 returned by the ListServerTlsPolicies method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.class, + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServerTlsPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (serverTlsPoliciesBuilder_ == null) { + serverTlsPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + serverTlsPoliciesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse build() { + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse buildPartial() { + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse result = + new com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse(this); + int from_bitField0_ = bitField0_; + if (serverTlsPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + serverTlsPolicies_ = java.util.Collections.unmodifiableList(serverTlsPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serverTlsPolicies_ = serverTlsPolicies_; + } else { + result.serverTlsPolicies_ = serverTlsPoliciesBuilder_.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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) { + return mergeFrom((com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse other) { + if (other + == com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.getDefaultInstance()) + return this; + if (serverTlsPoliciesBuilder_ == null) { + if (!other.serverTlsPolicies_.isEmpty()) { + if (serverTlsPolicies_.isEmpty()) { + serverTlsPolicies_ = other.serverTlsPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.addAll(other.serverTlsPolicies_); + } + onChanged(); + } + } else { + if (!other.serverTlsPolicies_.isEmpty()) { + if (serverTlsPoliciesBuilder_.isEmpty()) { + serverTlsPoliciesBuilder_.dispose(); + serverTlsPoliciesBuilder_ = null; + serverTlsPolicies_ = other.serverTlsPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + serverTlsPoliciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServerTlsPoliciesFieldBuilder() + : null; + } else { + serverTlsPoliciesBuilder_.addAllMessages(other.serverTlsPolicies_); + } + } + } + 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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List serverTlsPolicies_ = + java.util.Collections.emptyList(); + + private void ensureServerTlsPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serverTlsPolicies_ = + new java.util.ArrayList( + serverTlsPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder> + serverTlsPoliciesBuilder_; + + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public java.util.List + getServerTlsPoliciesList() { + if (serverTlsPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(serverTlsPolicies_); + } else { + return serverTlsPoliciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public int getServerTlsPoliciesCount() { + if (serverTlsPoliciesBuilder_ == null) { + return serverTlsPolicies_.size(); + } else { + return serverTlsPoliciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicies(int index) { + if (serverTlsPoliciesBuilder_ == null) { + return serverTlsPolicies_.get(index); + } else { + return serverTlsPoliciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder setServerTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.set(index, value); + onChanged(); + } else { + serverTlsPoliciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder setServerTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder builderForValue) { + if (serverTlsPoliciesBuilder_ == null) { + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + serverTlsPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder addServerTlsPolicies(com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.add(value); + onChanged(); + } else { + serverTlsPoliciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder addServerTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.add(index, value); + onChanged(); + } else { + serverTlsPoliciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder addServerTlsPolicies( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder builderForValue) { + if (serverTlsPoliciesBuilder_ == null) { + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.add(builderForValue.build()); + onChanged(); + } else { + serverTlsPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder addServerTlsPolicies( + int index, com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder builderForValue) { + if (serverTlsPoliciesBuilder_ == null) { + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + serverTlsPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder addAllServerTlsPolicies( + java.lang.Iterable values) { + if (serverTlsPoliciesBuilder_ == null) { + ensureServerTlsPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serverTlsPolicies_); + onChanged(); + } else { + serverTlsPoliciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder clearServerTlsPolicies() { + if (serverTlsPoliciesBuilder_ == null) { + serverTlsPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + serverTlsPoliciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public Builder removeServerTlsPolicies(int index) { + if (serverTlsPoliciesBuilder_ == null) { + ensureServerTlsPoliciesIsMutable(); + serverTlsPolicies_.remove(index); + onChanged(); + } else { + serverTlsPoliciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder getServerTlsPoliciesBuilder( + int index) { + return getServerTlsPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder + getServerTlsPoliciesOrBuilder(int index) { + if (serverTlsPoliciesBuilder_ == null) { + return serverTlsPolicies_.get(index); + } else { + return serverTlsPoliciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public java.util.List + getServerTlsPoliciesOrBuilderList() { + if (serverTlsPoliciesBuilder_ != null) { + return serverTlsPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serverTlsPolicies_); + } + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder + addServerTlsPoliciesBuilder() { + return getServerTlsPoliciesFieldBuilder() + .addBuilder(com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder addServerTlsPoliciesBuilder( + int index) { + return getServerTlsPoliciesFieldBuilder() + .addBuilder( + index, com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * List of ServerTlsPolicy resources.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + * + */ + public java.util.List + getServerTlsPoliciesBuilderList() { + return getServerTlsPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder> + getServerTlsPoliciesFieldBuilder() { + if (serverTlsPoliciesBuilder_ == null) { + serverTlsPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder>( + serverTlsPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + serverTlsPolicies_ = null; + } + return serverTlsPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `next_page_token` is included. To get the next set of results, call this
+     * method again using the value of `next_page_token` as `page_token`.
+     * 
+ * + * 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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + private static final com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse(); + } + + public static com.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServerTlsPoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServerTlsPoliciesResponse(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.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponseOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponseOrBuilder.java new file mode 100644 index 00000000..b3f1d3fc --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ListServerTlsPoliciesResponseOrBuilder.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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ListServerTlsPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + java.util.List getServerTlsPoliciesList(); + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicies(int index); + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + int getServerTlsPoliciesCount(); + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + java.util.List + getServerTlsPoliciesOrBuilderList(); + /** + * + * + *
+   * List of ServerTlsPolicy resources.
+   * 
+ * + * repeated .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policies = 1; + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder getServerTlsPoliciesOrBuilder( + int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `next_page_token` is included. To get the next set of results, call this
+   * method again using the value of `next_page_token` as `page_token`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/LocationName.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/LocationName.java new file mode 100644 index 00000000..72ad7432 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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.cloud.networksecurity.v1; + +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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityOuterClass.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityOuterClass.java new file mode 100644 index 00000000..6ff59866 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/NetworkSecurityOuterClass.java @@ -0,0 +1,189 @@ +/* + * 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/cloud/networksecurity/v1/network_security.proto + +package com.google.cloud.networksecurity.v1; + +public final class NetworkSecurityOuterClass { + private NetworkSecurityOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/networksecurity/v1/networ" + + "k_security.proto\022\037google.cloud.networkse" + + "curity.v1\032\034google/api/annotations.proto\032" + + "\027google/api/client.proto\032:google/cloud/n" + + "etworksecurity/v1/authorization_policy.p" + + "roto\0327google/cloud/networksecurity/v1/cl" + + "ient_tls_policy.proto\0327google/cloud/netw" + + "orksecurity/v1/server_tls_policy.proto\032#" + + "google/longrunning/operations.proto2\375 \n\017" + + "NetworkSecurity\022\356\001\n\031ListAuthorizationPol" + + "icies\022A.google.cloud.networksecurity.v1." + + "ListAuthorizationPoliciesRequest\032B.googl" + + "e.cloud.networksecurity.v1.ListAuthoriza" + + "tionPoliciesResponse\"J\202\323\344\223\002;\0229/v1/{paren" + + "t=projects/*/locations/*}/authorizationP" + + "olicies\332A\006parent\022\330\001\n\026GetAuthorizationPol" + + "icy\022>.google.cloud.networksecurity.v1.Ge" + + "tAuthorizationPolicyRequest\0324.google.clo" + + "ud.networksecurity.v1.AuthorizationPolic" + + "y\"H\202\323\344\223\002;\0229/v1/{name=projects/*/location" + + "s/*/authorizationPolicies/*}\332A\004name\022\330\002\n\031" + + "CreateAuthorizationPolicy\022A.google.cloud" + + ".networksecurity.v1.CreateAuthorizationP" + + "olicyRequest\032\035.google.longrunning.Operat" + + "ion\"\330\001\202\323\344\223\002Q\"9/v1/{parent=projects/*/loc" + + "ations/*}/authorizationPolicies:\024authori" + + "zation_policy\332A3parent,authorization_pol" + + "icy,authorization_policy_id\312AH\n\023Authoriz" + + "ationPolicy\0221google.cloud.networksecurit" + + "y.v1.OperationMetadata\022\332\002\n\031UpdateAuthori" + + "zationPolicy\022A.google.cloud.networksecur" + + "ity.v1.UpdateAuthorizationPolicyRequest\032" + + "\035.google.longrunning.Operation\"\332\001\202\323\344\223\002f2" + + "N/v1/{authorization_policy.name=projects" + + "/*/locations/*/authorizationPolicies/*}:" + + "\024authorization_policy\332A authorization_po" + + "licy,update_mask\312AH\n\023AuthorizationPolicy" + + "\0221google.cloud.networksecurity.v1.Operat" + + "ionMetadata\022\225\002\n\031DeleteAuthorizationPolic" + + "y\022A.google.cloud.networksecurity.v1.Dele" + + "teAuthorizationPolicyRequest\032\035.google.lo" + + "ngrunning.Operation\"\225\001\202\323\344\223\002;*9/v1/{name=" + + "projects/*/locations/*/authorizationPoli" + + "cies/*}\332A\004name\312AJ\n\025google.protobuf.Empty" + + "\0221google.cloud.networksecurity.v1.Operat" + + "ionMetadata\022\336\001\n\025ListServerTlsPolicies\022=." + + "google.cloud.networksecurity.v1.ListServ" + + "erTlsPoliciesRequest\032>.google.cloud.netw" + + "orksecurity.v1.ListServerTlsPoliciesResp" + + "onse\"F\202\323\344\223\0027\0225/v1/{parent=projects/*/loc" + + "ations/*}/serverTlsPolicies\332A\006parent\022\310\001\n" + + "\022GetServerTlsPolicy\022:.google.cloud.netwo" + + "rksecurity.v1.GetServerTlsPolicyRequest\032" + + "0.google.cloud.networksecurity.v1.Server" + + "TlsPolicy\"D\202\323\344\223\0027\0225/v1/{name=projects/*/" + + "locations/*/serverTlsPolicies/*}\332A\004name\022" + + "\277\002\n\025CreateServerTlsPolicy\022=.google.cloud" + + ".networksecurity.v1.CreateServerTlsPolic" + + "yRequest\032\035.google.longrunning.Operation\"" + + "\307\001\202\323\344\223\002J\"5/v1/{parent=projects/*/locatio" + + "ns/*}/serverTlsPolicies:\021server_tls_poli" + + "cy\332A-parent,server_tls_policy,server_tls" + + "_policy_id\312AD\n\017ServerTlsPolicy\0221google.c" + + "loud.networksecurity.v1.OperationMetadat" + + "a\022\301\002\n\025UpdateServerTlsPolicy\022=.google.clo" + + "ud.networksecurity.v1.UpdateServerTlsPol" + + "icyRequest\032\035.google.longrunning.Operatio" + + "n\"\311\001\202\323\344\223\002\\2G/v1/{server_tls_policy.name=" + + "projects/*/locations/*/serverTlsPolicies" + + "/*}:\021server_tls_policy\332A\035server_tls_poli" + + "cy,update_mask\312AD\n\017ServerTlsPolicy\0221goog" + + "le.cloud.networksecurity.v1.OperationMet" + + "adata\022\211\002\n\025DeleteServerTlsPolicy\022=.google" + + ".cloud.networksecurity.v1.DeleteServerTl" + + "sPolicyRequest\032\035.google.longrunning.Oper" + + "ation\"\221\001\202\323\344\223\0027*5/v1/{name=projects/*/loc" + + "ations/*/serverTlsPolicies/*}\332A\004name\312AJ\n" + + "\025google.protobuf.Empty\0221google.cloud.net" + + "worksecurity.v1.OperationMetadata\022\336\001\n\025Li" + + "stClientTlsPolicies\022=.google.cloud.netwo" + + "rksecurity.v1.ListClientTlsPoliciesReque" + + "st\032>.google.cloud.networksecurity.v1.Lis" + + "tClientTlsPoliciesResponse\"F\202\323\344\223\0027\0225/v1/" + + "{parent=projects/*/locations/*}/clientTl" + + "sPolicies\332A\006parent\022\310\001\n\022GetClientTlsPolic" + + "y\022:.google.cloud.networksecurity.v1.GetC" + + "lientTlsPolicyRequest\0320.google.cloud.net" + + "worksecurity.v1.ClientTlsPolicy\"D\202\323\344\223\0027\022" + + "5/v1/{name=projects/*/locations/*/client" + + "TlsPolicies/*}\332A\004name\022\277\002\n\025CreateClientTl" + + "sPolicy\022=.google.cloud.networksecurity.v" + + "1.CreateClientTlsPolicyRequest\032\035.google." + + "longrunning.Operation\"\307\001\202\323\344\223\002J\"5/v1/{par" + + "ent=projects/*/locations/*}/clientTlsPol" + + "icies:\021client_tls_policy\332A-parent,client" + + "_tls_policy,client_tls_policy_id\312AD\n\017Cli" + + "entTlsPolicy\0221google.cloud.networksecuri" + + "ty.v1.OperationMetadata\022\301\002\n\025UpdateClient" + + "TlsPolicy\022=.google.cloud.networksecurity" + + ".v1.UpdateClientTlsPolicyRequest\032\035.googl" + + "e.longrunning.Operation\"\311\001\202\323\344\223\002\\2G/v1/{c" + + "lient_tls_policy.name=projects/*/locatio" + + "ns/*/clientTlsPolicies/*}:\021client_tls_po" + + "licy\332A\035client_tls_policy,update_mask\312AD\n" + + "\017ClientTlsPolicy\0221google.cloud.networkse" + + "curity.v1.OperationMetadata\022\211\002\n\025DeleteCl" + + "ientTlsPolicy\022=.google.cloud.networksecu" + + "rity.v1.DeleteClientTlsPolicyRequest\032\035.g" + + "oogle.longrunning.Operation\"\221\001\202\323\344\223\0027*5/v" + + "1/{name=projects/*/locations/*/clientTls" + + "Policies/*}\332A\004name\312AJ\n\025google.protobuf.E" + + "mpty\0221google.cloud.networksecurity.v1.Op" + + "erationMetadata\032R\312A\036networksecurity.goog" + + "leapis.com\322A.https://www.googleapis.com/" + + "auth/cloud-platformB\340\001\n#com.google.cloud" + + ".networksecurity.v1P\001ZNgoogle.golang.org" + + "/genproto/googleapis/cloud/networksecuri" + + "ty/v1;networksecurity\252\002\037Google.Cloud.Net" + + "workSecurity.V1\312\002\037Google\\Cloud\\NetworkSe" + + "curity\\V1\352\002\"Google::Cloud::NetworkSecuri" + + "ty::V1b\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.cloud.networksecurity.v1.AuthorizationPolicyProto.getDescriptor(), + com.google.cloud.networksecurity.v1.ClientTlsPolicyProto.getDescriptor(), + com.google.cloud.networksecurity.v1.ServerTlsPolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + 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.cloud.networksecurity.v1.AuthorizationPolicyProto.getDescriptor(); + com.google.cloud.networksecurity.v1.ClientTlsPolicyProto.getDescriptor(); + com.google.cloud.networksecurity.v1.ServerTlsPolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadata.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadata.java new file mode 100644 index 00000000..832bc7a2 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadata.java @@ -0,0 +1,1851 @@ +/* + * 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/cloud/networksecurity/v1/common.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + 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; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 48: + { + requestedCancellation_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = 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.cloud.networksecurity.v1.CommonProto + .internal_static_google_cloud_networksecurity_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.CommonProto + .internal_static_google_cloud_networksecurity_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.OperationMetadata.class, + com.google.cloud.networksecurity.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + 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()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + 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.cloud.networksecurity.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.OperationMetadata other = + (com.google.cloud.networksecurity.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata 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.cloud.networksecurity.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata 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.cloud.networksecurity.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata 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.cloud.networksecurity.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata 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.cloud.networksecurity.v1.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.OperationMetadata) + com.google.cloud.networksecurity.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.CommonProto + .internal_static_google_cloud_networksecurity_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.CommonProto + .internal_static_google_cloud_networksecurity_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.OperationMetadata.class, + com.google.cloud.networksecurity.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.OperationMetadata.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; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusMessage_ = ""; + + requestedCancellation_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.CommonProto + .internal_static_google_cloud_networksecurity_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.OperationMetadata build() { + com.google.cloud.networksecurity.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.OperationMetadata buildPartial() { + com.google.cloud.networksecurity.v1.OperationMetadata result = + new com.google.cloud.networksecurity.v1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusMessage_ = statusMessage_; + result.requestedCancellation_ = requestedCancellation_; + result.apiVersion_ = apiVersion_; + 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.cloud.networksecurity.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.networksecurity.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.OperationMetadata other) { + if (other == com.google.cloud.networksecurity.v1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + 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.cloud.networksecurity.v1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.OperationMetadata) 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_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = 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.cloud.networksecurity.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.OperationMetadata) + private static final com.google.cloud.networksecurity.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.OperationMetadata(); + } + + public static com.google.cloud.networksecurity.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(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.cloud.networksecurity.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadataOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..29dbebc5 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,217 @@ +/* + * 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/cloud/networksecurity/v1/common.proto + +package com.google.cloud.networksecurity.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicy.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicy.java new file mode 100644 index 00000000..d7dc77eb --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicy.java @@ -0,0 +1,3566 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * ServerTlsPolicy is a resource that specifies how a server should authenticate
+ * incoming requests. This resource itself does not affect configuration unless
+ * it is attached to a target https proxy or endpoint config selector resource.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ServerTlsPolicy} + */ +public final class ServerTlsPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ServerTlsPolicy) + ServerTlsPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServerTlsPolicy.newBuilder() to construct. + private ServerTlsPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServerTlsPolicy() { + name_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServerTlsPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServerTlsPolicy( + 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(); + + description_ = s; + break; + } + case 26: + { + 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 34: + { + 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 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 48: + { + allowOpen_ = input.readBool(); + break; + } + case 58: + { + com.google.cloud.networksecurity.v1.CertificateProvider.Builder subBuilder = null; + if (serverCertificate_ != null) { + subBuilder = serverCertificate_.toBuilder(); + } + serverCertificate_ = + input.readMessage( + com.google.cloud.networksecurity.v1.CertificateProvider.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serverCertificate_); + serverCertificate_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder subBuilder = + null; + if (mtlsPolicy_ != null) { + subBuilder = mtlsPolicy_.toBuilder(); + } + mtlsPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mtlsPolicy_); + mtlsPolicy_ = 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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.class, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder.class); + } + + public interface MTLSPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + java.util.List getClientValidationCaList(); + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + com.google.cloud.networksecurity.v1.ValidationCA getClientValidationCa(int index); + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + int getClientValidationCaCount(); + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + java.util.List + getClientValidationCaOrBuilderList(); + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder getClientValidationCaOrBuilder( + int index); + } + /** + * + * + *
+   * Specification of the MTLSPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} + */ + public static final class MTLSPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + MTLSPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use MTLSPolicy.newBuilder() to construct. + private MTLSPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MTLSPolicy() { + clientValidationCa_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MTLSPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MTLSPolicy( + 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)) { + clientValidationCa_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + clientValidationCa_.add( + input.readMessage( + com.google.cloud.networksecurity.v1.ValidationCA.parser(), + extensionRegistry)); + 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)) { + clientValidationCa_ = java.util.Collections.unmodifiableList(clientValidationCa_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.class, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder.class); + } + + public static final int CLIENT_VALIDATION_CA_FIELD_NUMBER = 1; + private java.util.List clientValidationCa_; + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + @java.lang.Override + public java.util.List + getClientValidationCaList() { + return clientValidationCa_; + } + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + @java.lang.Override + public java.util.List + getClientValidationCaOrBuilderList() { + return clientValidationCa_; + } + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + @java.lang.Override + public int getClientValidationCaCount() { + return clientValidationCa_.size(); + } + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCA getClientValidationCa(int index) { + return clientValidationCa_.get(index); + } + /** + * + * + *
+     * Defines the mechanism to obtain the Certificate Authority certificate to
+     * validate the client certificate.
+     * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCAOrBuilder getClientValidationCaOrBuilder( + int index) { + return clientValidationCa_.get(index); + } + + 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 < clientValidationCa_.size(); i++) { + output.writeMessage(1, clientValidationCa_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < clientValidationCa_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, clientValidationCa_.get(i)); + } + 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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy other = + (com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) obj; + + if (!getClientValidationCaList().equals(other.getClientValidationCaList())) 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 (getClientValidationCaCount() > 0) { + hash = (37 * hash) + CLIENT_VALIDATION_CA_FIELD_NUMBER; + hash = (53 * hash) + getClientValidationCaList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy 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; + } + /** + * + * + *
+     * Specification of the MTLSPolicy.
+     * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.class, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClientValidationCaFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (clientValidationCaBuilder_ == null) { + clientValidationCa_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + clientValidationCaBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy build() { + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy buildPartial() { + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy result = + new com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy(this); + int from_bitField0_ = bitField0_; + if (clientValidationCaBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clientValidationCa_ = java.util.Collections.unmodifiableList(clientValidationCa_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clientValidationCa_ = clientValidationCa_; + } else { + result.clientValidationCa_ = clientValidationCaBuilder_.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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) { + return mergeFrom((com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy other) { + if (other + == com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.getDefaultInstance()) + return this; + if (clientValidationCaBuilder_ == null) { + if (!other.clientValidationCa_.isEmpty()) { + if (clientValidationCa_.isEmpty()) { + clientValidationCa_ = other.clientValidationCa_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClientValidationCaIsMutable(); + clientValidationCa_.addAll(other.clientValidationCa_); + } + onChanged(); + } + } else { + if (!other.clientValidationCa_.isEmpty()) { + if (clientValidationCaBuilder_.isEmpty()) { + clientValidationCaBuilder_.dispose(); + clientValidationCaBuilder_ = null; + clientValidationCa_ = other.clientValidationCa_; + bitField0_ = (bitField0_ & ~0x00000001); + clientValidationCaBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClientValidationCaFieldBuilder() + : null; + } else { + clientValidationCaBuilder_.addAllMessages(other.clientValidationCa_); + } + } + } + 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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List clientValidationCa_ = + java.util.Collections.emptyList(); + + private void ensureClientValidationCaIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clientValidationCa_ = + new java.util.ArrayList( + clientValidationCa_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ValidationCA, + com.google.cloud.networksecurity.v1.ValidationCA.Builder, + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder> + clientValidationCaBuilder_; + + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public java.util.List + getClientValidationCaList() { + if (clientValidationCaBuilder_ == null) { + return java.util.Collections.unmodifiableList(clientValidationCa_); + } else { + return clientValidationCaBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public int getClientValidationCaCount() { + if (clientValidationCaBuilder_ == null) { + return clientValidationCa_.size(); + } else { + return clientValidationCaBuilder_.getCount(); + } + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA getClientValidationCa(int index) { + if (clientValidationCaBuilder_ == null) { + return clientValidationCa_.get(index); + } else { + return clientValidationCaBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder setClientValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA value) { + if (clientValidationCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientValidationCaIsMutable(); + clientValidationCa_.set(index, value); + onChanged(); + } else { + clientValidationCaBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder setClientValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA.Builder builderForValue) { + if (clientValidationCaBuilder_ == null) { + ensureClientValidationCaIsMutable(); + clientValidationCa_.set(index, builderForValue.build()); + onChanged(); + } else { + clientValidationCaBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder addClientValidationCa(com.google.cloud.networksecurity.v1.ValidationCA value) { + if (clientValidationCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientValidationCaIsMutable(); + clientValidationCa_.add(value); + onChanged(); + } else { + clientValidationCaBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder addClientValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA value) { + if (clientValidationCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClientValidationCaIsMutable(); + clientValidationCa_.add(index, value); + onChanged(); + } else { + clientValidationCaBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder addClientValidationCa( + com.google.cloud.networksecurity.v1.ValidationCA.Builder builderForValue) { + if (clientValidationCaBuilder_ == null) { + ensureClientValidationCaIsMutable(); + clientValidationCa_.add(builderForValue.build()); + onChanged(); + } else { + clientValidationCaBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder addClientValidationCa( + int index, com.google.cloud.networksecurity.v1.ValidationCA.Builder builderForValue) { + if (clientValidationCaBuilder_ == null) { + ensureClientValidationCaIsMutable(); + clientValidationCa_.add(index, builderForValue.build()); + onChanged(); + } else { + clientValidationCaBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder addAllClientValidationCa( + java.lang.Iterable values) { + if (clientValidationCaBuilder_ == null) { + ensureClientValidationCaIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clientValidationCa_); + onChanged(); + } else { + clientValidationCaBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder clearClientValidationCa() { + if (clientValidationCaBuilder_ == null) { + clientValidationCa_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clientValidationCaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public Builder removeClientValidationCa(int index) { + if (clientValidationCaBuilder_ == null) { + ensureClientValidationCaIsMutable(); + clientValidationCa_.remove(index); + onChanged(); + } else { + clientValidationCaBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA.Builder getClientValidationCaBuilder( + int index) { + return getClientValidationCaFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCAOrBuilder + getClientValidationCaOrBuilder(int index) { + if (clientValidationCaBuilder_ == null) { + return clientValidationCa_.get(index); + } else { + return clientValidationCaBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public java.util.List + getClientValidationCaOrBuilderList() { + if (clientValidationCaBuilder_ != null) { + return clientValidationCaBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clientValidationCa_); + } + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA.Builder + addClientValidationCaBuilder() { + return getClientValidationCaFieldBuilder() + .addBuilder(com.google.cloud.networksecurity.v1.ValidationCA.getDefaultInstance()); + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public com.google.cloud.networksecurity.v1.ValidationCA.Builder addClientValidationCaBuilder( + int index) { + return getClientValidationCaFieldBuilder() + .addBuilder( + index, com.google.cloud.networksecurity.v1.ValidationCA.getDefaultInstance()); + } + /** + * + * + *
+       * Defines the mechanism to obtain the Certificate Authority certificate to
+       * validate the client certificate.
+       * 
+ * + * repeated .google.cloud.networksecurity.v1.ValidationCA client_validation_ca = 1; + * + */ + public java.util.List + getClientValidationCaBuilderList() { + return getClientValidationCaFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ValidationCA, + com.google.cloud.networksecurity.v1.ValidationCA.Builder, + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder> + getClientValidationCaFieldBuilder() { + if (clientValidationCaBuilder_ == null) { + clientValidationCaBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networksecurity.v1.ValidationCA, + com.google.cloud.networksecurity.v1.ValidationCA.Builder, + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder>( + clientValidationCa_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + clientValidationCa_ = null; + } + return clientValidationCaBuilder_; + } + + @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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + private static final com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy(); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MTLSPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MTLSPolicy(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.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the ServerTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+   * 
+ * + * 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. Name of the ServerTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+   * 
+ * + * 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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Free-text description of the resource.
+   * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+   * Free-text description of the resource.
+   * 
+ * + * string description = 2; + * + * @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; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ALLOW_OPEN_FIELD_NUMBER = 6; + private boolean allowOpen_; + /** + * + * + *
+   * Determines if server allows plaintext connections. If set to true, server
+   * allows plain text connections. By default, it is set to false. This setting
+   * is not exclusive of other encryption modes. For example, if `allow_open`
+   * and `mtls_policy` are set, server allows both plain text and mTLS
+   * connections. See documentation of other encryption modes to confirm
+   * compatibility.
+   * Consider using it if you wish to upgrade in place your deployment to TLS
+   * while having mixed TLS and non-TLS traffic reaching port :80.
+   * 
+ * + * bool allow_open = 6; + * + * @return The allowOpen. + */ + @java.lang.Override + public boolean getAllowOpen() { + return allowOpen_; + } + + public static final int SERVER_CERTIFICATE_FIELD_NUMBER = 7; + private com.google.cloud.networksecurity.v1.CertificateProvider serverCertificate_; + /** + * + * + *
+   * Defines a mechanism to provision server identity (public and private keys).
+   * Cannot be combined with `allow_open` as a permissive mode that allows both
+   * plain text and TLS is not supported.
+   * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + * + * @return Whether the serverCertificate field is set. + */ + @java.lang.Override + public boolean hasServerCertificate() { + return serverCertificate_ != null; + } + /** + * + * + *
+   * Defines a mechanism to provision server identity (public and private keys).
+   * Cannot be combined with `allow_open` as a permissive mode that allows both
+   * plain text and TLS is not supported.
+   * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + * + * @return The serverCertificate. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProvider getServerCertificate() { + return serverCertificate_ == null + ? com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance() + : serverCertificate_; + } + /** + * + * + *
+   * Defines a mechanism to provision server identity (public and private keys).
+   * Cannot be combined with `allow_open` as a permissive mode that allows both
+   * plain text and TLS is not supported.
+   * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder + getServerCertificateOrBuilder() { + return getServerCertificate(); + } + + public static final int MTLS_POLICY_FIELD_NUMBER = 8; + private com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtlsPolicy_; + /** + * + * + *
+   * Defines a mechanism to provision peer validation certificates for peer to
+   * peer authentication (Mutual TLS - mTLS). If not specified, client
+   * certificate will not be requested. The connection is treated as TLS and not
+   * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+   * text and mTLS connections.
+   * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + * + * @return Whether the mtlsPolicy field is set. + */ + @java.lang.Override + public boolean hasMtlsPolicy() { + return mtlsPolicy_ != null; + } + /** + * + * + *
+   * Defines a mechanism to provision peer validation certificates for peer to
+   * peer authentication (Mutual TLS - mTLS). If not specified, client
+   * certificate will not be requested. The connection is treated as TLS and not
+   * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+   * text and mTLS connections.
+   * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + * + * @return The mtlsPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy getMtlsPolicy() { + return mtlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.getDefaultInstance() + : mtlsPolicy_; + } + /** + * + * + *
+   * Defines a mechanism to provision peer validation certificates for peer to
+   * peer authentication (Mutual TLS - mTLS). If not specified, client
+   * certificate will not be requested. The connection is treated as TLS and not
+   * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+   * text and mTLS connections.
+   * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder + getMtlsPolicyOrBuilder() { + return getMtlsPolicy(); + } + + 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(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (allowOpen_ != false) { + output.writeBool(6, allowOpen_); + } + if (serverCertificate_ != null) { + output.writeMessage(7, getServerCertificate()); + } + if (mtlsPolicy_ != null) { + output.writeMessage(8, getMtlsPolicy()); + } + 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(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); + } + if (allowOpen_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, allowOpen_); + } + if (serverCertificate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getServerCertificate()); + } + if (mtlsPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getMtlsPolicy()); + } + 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.cloud.networksecurity.v1.ServerTlsPolicy)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ServerTlsPolicy other = + (com.google.cloud.networksecurity.v1.ServerTlsPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) 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 (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (getAllowOpen() != other.getAllowOpen()) return false; + if (hasServerCertificate() != other.hasServerCertificate()) return false; + if (hasServerCertificate()) { + if (!getServerCertificate().equals(other.getServerCertificate())) return false; + } + if (hasMtlsPolicy() != other.hasMtlsPolicy()) return false; + if (hasMtlsPolicy()) { + if (!getMtlsPolicy().equals(other.getMtlsPolicy())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().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 (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + ALLOW_OPEN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowOpen()); + if (hasServerCertificate()) { + hash = (37 * hash) + SERVER_CERTIFICATE_FIELD_NUMBER; + hash = (53 * hash) + getServerCertificate().hashCode(); + } + if (hasMtlsPolicy()) { + hash = (37 * hash) + MTLS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getMtlsPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy 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.cloud.networksecurity.v1.ServerTlsPolicy 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; + } + /** + * + * + *
+   * ServerTlsPolicy is a resource that specifies how a server should authenticate
+   * incoming requests. This resource itself does not affect configuration unless
+   * it is attached to a target https proxy or endpoint config selector resource.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ServerTlsPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ServerTlsPolicy) + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.class, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.ServerTlsPolicy.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_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + allowOpen_ = false; + + if (serverCertificateBuilder_ == null) { + serverCertificate_ = null; + } else { + serverCertificate_ = null; + serverCertificateBuilder_ = null; + } + if (mtlsPolicyBuilder_ == null) { + mtlsPolicy_ = null; + } else { + mtlsPolicy_ = null; + mtlsPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy build() { + com.google.cloud.networksecurity.v1.ServerTlsPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy buildPartial() { + com.google.cloud.networksecurity.v1.ServerTlsPolicy result = + new com.google.cloud.networksecurity.v1.ServerTlsPolicy(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.allowOpen_ = allowOpen_; + if (serverCertificateBuilder_ == null) { + result.serverCertificate_ = serverCertificate_; + } else { + result.serverCertificate_ = serverCertificateBuilder_.build(); + } + if (mtlsPolicyBuilder_ == null) { + result.mtlsPolicy_ = mtlsPolicy_; + } else { + result.mtlsPolicy_ = mtlsPolicyBuilder_.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.cloud.networksecurity.v1.ServerTlsPolicy) { + return mergeFrom((com.google.cloud.networksecurity.v1.ServerTlsPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.ServerTlsPolicy other) { + if (other == com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.getAllowOpen() != false) { + setAllowOpen(other.getAllowOpen()); + } + if (other.hasServerCertificate()) { + mergeServerCertificate(other.getServerCertificate()); + } + if (other.hasMtlsPolicy()) { + mergeMtlsPolicy(other.getMtlsPolicy()); + } + 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.cloud.networksecurity.v1.ServerTlsPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.ServerTlsPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the ServerTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+     * 
+ * + * 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. Name of the ServerTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+     * 
+ * + * 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. Name of the ServerTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+     * 
+ * + * 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. Name of the ServerTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the ServerTlsPolicy resource. It matches the pattern
+     * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+     * 
+ * + * 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 description_ = ""; + /** + * + * + *
+     * Free-text description of the resource.
+     * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+     * Free-text description of the resource.
+     * 
+ * + * string description = 2; + * + * @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; + } + } + /** + * + * + *
+     * Free-text description of the resource.
+     * 
+ * + * string description = 2; + * + * @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; + } + /** + * + * + *
+     * Free-text description of the resource.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Free-text description of the resource.
+     * 
+ * + * string description = 2; + * + * @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; + } + + 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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 timestamp when the resource was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Set of label tags associated with the resource.
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private boolean allowOpen_; + /** + * + * + *
+     * Determines if server allows plaintext connections. If set to true, server
+     * allows plain text connections. By default, it is set to false. This setting
+     * is not exclusive of other encryption modes. For example, if `allow_open`
+     * and `mtls_policy` are set, server allows both plain text and mTLS
+     * connections. See documentation of other encryption modes to confirm
+     * compatibility.
+     * Consider using it if you wish to upgrade in place your deployment to TLS
+     * while having mixed TLS and non-TLS traffic reaching port :80.
+     * 
+ * + * bool allow_open = 6; + * + * @return The allowOpen. + */ + @java.lang.Override + public boolean getAllowOpen() { + return allowOpen_; + } + /** + * + * + *
+     * Determines if server allows plaintext connections. If set to true, server
+     * allows plain text connections. By default, it is set to false. This setting
+     * is not exclusive of other encryption modes. For example, if `allow_open`
+     * and `mtls_policy` are set, server allows both plain text and mTLS
+     * connections. See documentation of other encryption modes to confirm
+     * compatibility.
+     * Consider using it if you wish to upgrade in place your deployment to TLS
+     * while having mixed TLS and non-TLS traffic reaching port :80.
+     * 
+ * + * bool allow_open = 6; + * + * @param value The allowOpen to set. + * @return This builder for chaining. + */ + public Builder setAllowOpen(boolean value) { + + allowOpen_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Determines if server allows plaintext connections. If set to true, server
+     * allows plain text connections. By default, it is set to false. This setting
+     * is not exclusive of other encryption modes. For example, if `allow_open`
+     * and `mtls_policy` are set, server allows both plain text and mTLS
+     * connections. See documentation of other encryption modes to confirm
+     * compatibility.
+     * Consider using it if you wish to upgrade in place your deployment to TLS
+     * while having mixed TLS and non-TLS traffic reaching port :80.
+     * 
+ * + * bool allow_open = 6; + * + * @return This builder for chaining. + */ + public Builder clearAllowOpen() { + + allowOpen_ = false; + onChanged(); + return this; + } + + private com.google.cloud.networksecurity.v1.CertificateProvider serverCertificate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProvider, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder> + serverCertificateBuilder_; + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + * + * @return Whether the serverCertificate field is set. + */ + public boolean hasServerCertificate() { + return serverCertificateBuilder_ != null || serverCertificate_ != null; + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + * + * @return The serverCertificate. + */ + public com.google.cloud.networksecurity.v1.CertificateProvider getServerCertificate() { + if (serverCertificateBuilder_ == null) { + return serverCertificate_ == null + ? com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance() + : serverCertificate_; + } else { + return serverCertificateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + public Builder setServerCertificate( + com.google.cloud.networksecurity.v1.CertificateProvider value) { + if (serverCertificateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCertificate_ = value; + onChanged(); + } else { + serverCertificateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + public Builder setServerCertificate( + com.google.cloud.networksecurity.v1.CertificateProvider.Builder builderForValue) { + if (serverCertificateBuilder_ == null) { + serverCertificate_ = builderForValue.build(); + onChanged(); + } else { + serverCertificateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + public Builder mergeServerCertificate( + com.google.cloud.networksecurity.v1.CertificateProvider value) { + if (serverCertificateBuilder_ == null) { + if (serverCertificate_ != null) { + serverCertificate_ = + com.google.cloud.networksecurity.v1.CertificateProvider.newBuilder(serverCertificate_) + .mergeFrom(value) + .buildPartial(); + } else { + serverCertificate_ = value; + } + onChanged(); + } else { + serverCertificateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + public Builder clearServerCertificate() { + if (serverCertificateBuilder_ == null) { + serverCertificate_ = null; + onChanged(); + } else { + serverCertificate_ = null; + serverCertificateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + public com.google.cloud.networksecurity.v1.CertificateProvider.Builder + getServerCertificateBuilder() { + + onChanged(); + return getServerCertificateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + public com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder + getServerCertificateOrBuilder() { + if (serverCertificateBuilder_ != null) { + return serverCertificateBuilder_.getMessageOrBuilder(); + } else { + return serverCertificate_ == null + ? com.google.cloud.networksecurity.v1.CertificateProvider.getDefaultInstance() + : serverCertificate_; + } + } + /** + * + * + *
+     * Defines a mechanism to provision server identity (public and private keys).
+     * Cannot be combined with `allow_open` as a permissive mode that allows both
+     * plain text and TLS is not supported.
+     * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProvider, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder> + getServerCertificateFieldBuilder() { + if (serverCertificateBuilder_ == null) { + serverCertificateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProvider, + com.google.cloud.networksecurity.v1.CertificateProvider.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder>( + getServerCertificate(), getParentForChildren(), isClean()); + serverCertificate_ = null; + } + return serverCertificateBuilder_; + } + + private com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtlsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder> + mtlsPolicyBuilder_; + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + * + * @return Whether the mtlsPolicy field is set. + */ + public boolean hasMtlsPolicy() { + return mtlsPolicyBuilder_ != null || mtlsPolicy_ != null; + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + * + * @return The mtlsPolicy. + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy getMtlsPolicy() { + if (mtlsPolicyBuilder_ == null) { + return mtlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.getDefaultInstance() + : mtlsPolicy_; + } else { + return mtlsPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + public Builder setMtlsPolicy( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy value) { + if (mtlsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mtlsPolicy_ = value; + onChanged(); + } else { + mtlsPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + public Builder setMtlsPolicy( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder builderForValue) { + if (mtlsPolicyBuilder_ == null) { + mtlsPolicy_ = builderForValue.build(); + onChanged(); + } else { + mtlsPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + public Builder mergeMtlsPolicy( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy value) { + if (mtlsPolicyBuilder_ == null) { + if (mtlsPolicy_ != null) { + mtlsPolicy_ = + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.newBuilder(mtlsPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + mtlsPolicy_ = value; + } + onChanged(); + } else { + mtlsPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + public Builder clearMtlsPolicy() { + if (mtlsPolicyBuilder_ == null) { + mtlsPolicy_ = null; + onChanged(); + } else { + mtlsPolicy_ = null; + mtlsPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder + getMtlsPolicyBuilder() { + + onChanged(); + return getMtlsPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder + getMtlsPolicyOrBuilder() { + if (mtlsPolicyBuilder_ != null) { + return mtlsPolicyBuilder_.getMessageOrBuilder(); + } else { + return mtlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.getDefaultInstance() + : mtlsPolicy_; + } + } + /** + * + * + *
+     * Defines a mechanism to provision peer validation certificates for peer to
+     * peer authentication (Mutual TLS - mTLS). If not specified, client
+     * certificate will not be requested. The connection is treated as TLS and not
+     * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+     * text and mTLS connections.
+     * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder> + getMtlsPolicyFieldBuilder() { + if (mtlsPolicyBuilder_ == null) { + mtlsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder>( + getMtlsPolicy(), getParentForChildren(), isClean()); + mtlsPolicy_ = null; + } + return mtlsPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.ServerTlsPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ServerTlsPolicy) + private static final com.google.cloud.networksecurity.v1.ServerTlsPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ServerTlsPolicy(); + } + + public static com.google.cloud.networksecurity.v1.ServerTlsPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServerTlsPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServerTlsPolicy(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.cloud.networksecurity.v1.ServerTlsPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyName.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyName.java new file mode 100644 index 00000000..f5bbd6a6 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyName.java @@ -0,0 +1,227 @@ +/* + * 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.cloud.networksecurity.v1; + +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 ServerTlsPolicyName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SERVER_TLS_POLICY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String serverTlsPolicy; + + @Deprecated + protected ServerTlsPolicyName() { + project = null; + location = null; + serverTlsPolicy = null; + } + + private ServerTlsPolicyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + serverTlsPolicy = Preconditions.checkNotNull(builder.getServerTlsPolicy()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getServerTlsPolicy() { + return serverTlsPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ServerTlsPolicyName of(String project, String location, String serverTlsPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setServerTlsPolicy(serverTlsPolicy) + .build(); + } + + public static String format(String project, String location, String serverTlsPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setServerTlsPolicy(serverTlsPolicy) + .build() + .toString(); + } + + public static ServerTlsPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_SERVER_TLS_POLICY.validatedMatch( + formattedString, "ServerTlsPolicyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("server_tls_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 (ServerTlsPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SERVER_TLS_POLICY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (serverTlsPolicy != null) { + fieldMapBuilder.put("server_tls_policy", serverTlsPolicy); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_SERVER_TLS_POLICY.instantiate( + "project", project, "location", location, "server_tls_policy", serverTlsPolicy); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ServerTlsPolicyName that = ((ServerTlsPolicyName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.serverTlsPolicy, that.serverTlsPolicy); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(serverTlsPolicy); + return h; + } + + /** Builder for projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}. */ + public static class Builder { + private String project; + private String location; + private String serverTlsPolicy; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getServerTlsPolicy() { + return serverTlsPolicy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setServerTlsPolicy(String serverTlsPolicy) { + this.serverTlsPolicy = serverTlsPolicy; + return this; + } + + private Builder(ServerTlsPolicyName serverTlsPolicyName) { + this.project = serverTlsPolicyName.project; + this.location = serverTlsPolicyName.location; + this.serverTlsPolicy = serverTlsPolicyName.serverTlsPolicy; + } + + public ServerTlsPolicyName build() { + return new ServerTlsPolicyName(this); + } + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyOrBuilder.java new file mode 100644 index 00000000..7552b879 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyOrBuilder.java @@ -0,0 +1,320 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface ServerTlsPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ServerTlsPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the ServerTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the ServerTlsPolicy resource. It matches the pattern
+   * `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Free-text description of the resource.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Free-text description of the resource.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp when the resource was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + int getLabelsCount(); + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Set of label tags associated with the resource.
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Determines if server allows plaintext connections. If set to true, server
+   * allows plain text connections. By default, it is set to false. This setting
+   * is not exclusive of other encryption modes. For example, if `allow_open`
+   * and `mtls_policy` are set, server allows both plain text and mTLS
+   * connections. See documentation of other encryption modes to confirm
+   * compatibility.
+   * Consider using it if you wish to upgrade in place your deployment to TLS
+   * while having mixed TLS and non-TLS traffic reaching port :80.
+   * 
+ * + * bool allow_open = 6; + * + * @return The allowOpen. + */ + boolean getAllowOpen(); + + /** + * + * + *
+   * Defines a mechanism to provision server identity (public and private keys).
+   * Cannot be combined with `allow_open` as a permissive mode that allows both
+   * plain text and TLS is not supported.
+   * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + * + * @return Whether the serverCertificate field is set. + */ + boolean hasServerCertificate(); + /** + * + * + *
+   * Defines a mechanism to provision server identity (public and private keys).
+   * Cannot be combined with `allow_open` as a permissive mode that allows both
+   * plain text and TLS is not supported.
+   * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + * + * @return The serverCertificate. + */ + com.google.cloud.networksecurity.v1.CertificateProvider getServerCertificate(); + /** + * + * + *
+   * Defines a mechanism to provision server identity (public and private keys).
+   * Cannot be combined with `allow_open` as a permissive mode that allows both
+   * plain text and TLS is not supported.
+   * 
+ * + * .google.cloud.networksecurity.v1.CertificateProvider server_certificate = 7; + */ + com.google.cloud.networksecurity.v1.CertificateProviderOrBuilder getServerCertificateOrBuilder(); + + /** + * + * + *
+   * Defines a mechanism to provision peer validation certificates for peer to
+   * peer authentication (Mutual TLS - mTLS). If not specified, client
+   * certificate will not be requested. The connection is treated as TLS and not
+   * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+   * text and mTLS connections.
+   * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + * + * @return Whether the mtlsPolicy field is set. + */ + boolean hasMtlsPolicy(); + /** + * + * + *
+   * Defines a mechanism to provision peer validation certificates for peer to
+   * peer authentication (Mutual TLS - mTLS). If not specified, client
+   * certificate will not be requested. The connection is treated as TLS and not
+   * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+   * text and mTLS connections.
+   * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + * + * @return The mtlsPolicy. + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy getMtlsPolicy(); + /** + * + * + *
+   * Defines a mechanism to provision peer validation certificates for peer to
+   * peer authentication (Mutual TLS - mTLS). If not specified, client
+   * certificate will not be requested. The connection is treated as TLS and not
+   * mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
+   * text and mTLS connections.
+   * 
+ * + * .google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy mtls_policy = 8; + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicyOrBuilder getMtlsPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyProto.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyProto.java new file mode 100644 index 00000000..5c41d6a4 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ServerTlsPolicyProto.java @@ -0,0 +1,236 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public final class ServerTlsPolicyProto { + private ServerTlsPolicyProto() {} + + 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_cloud_networksecurity_v1_ServerTlsPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/networksecurity/v1/server" + + "_tls_policy.proto\022\037google.cloud.networks" + + "ecurity.v1\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032)google/c" + + "loud/networksecurity/v1/tls.proto\032 googl" + + "e/protobuf/field_mask.proto\032\037google/prot" + + "obuf/timestamp.proto\"\272\005\n\017ServerTlsPolicy" + + "\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\023\n\013description\030\002 \001(\t" + + "\0224\n\013create_time\030\003 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0224\n\013update_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\022L\n\006labels\030\005" + + " \003(\0132<.google.cloud.networksecurity.v1.S" + + "erverTlsPolicy.LabelsEntry\022\022\n\nallow_open" + + "\030\006 \001(\010\022P\n\022server_certificate\030\007 \001(\01324.goo" + + "gle.cloud.networksecurity.v1.Certificate" + + "Provider\022P\n\013mtls_policy\030\010 \001(\0132;.google.c" + + "loud.networksecurity.v1.ServerTlsPolicy." + + "MTLSPolicy\032Y\n\nMTLSPolicy\022K\n\024client_valid" + + "ation_ca\030\001 \003(\0132-.google.cloud.networksec" + + "urity.v1.ValidationCA\032-\n\013LabelsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\202\001\352A\177\n.netw" + + "orksecurity.googleapis.com/ServerTlsPoli" + + "cy\022Mprojects/{project}/locations/{locati" + + "on}/serverTlsPolicies/{server_tls_policy" + + "}\"\200\001\n\034ListServerTlsPoliciesRequest\0229\n\006pa" + + "rent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis" + + ".com/Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\"\207\001\n\035ListServerTlsPoliciesRe" + + "sponse\022M\n\023server_tls_policies\030\001 \003(\01320.go" + + "ogle.cloud.networksecurity.v1.ServerTlsP" + + "olicy\022\027\n\017next_page_token\030\002 \001(\t\"a\n\031GetSer" + + "verTlsPolicyRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A" + + "0\n.networksecurity.googleapis.com/Server" + + "TlsPolicy\"\333\001\n\034CreateServerTlsPolicyReque" + + "st\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.networksecur" + + "ity.googleapis.com/ServerTlsPolicy\022!\n\024se" + + "rver_tls_policy_id\030\002 \001(\tB\003\340A\002\022P\n\021server_" + + "tls_policy\030\003 \001(\01320.google.cloud.networks" + + "ecurity.v1.ServerTlsPolicyB\003\340A\002\"\246\001\n\034Upda" + + "teServerTlsPolicyRequest\0224\n\013update_mask\030" + + "\001 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\022P" + + "\n\021server_tls_policy\030\002 \001(\01320.google.cloud" + + ".networksecurity.v1.ServerTlsPolicyB\003\340A\002" + + "\"d\n\034DeleteServerTlsPolicyRequest\022D\n\004name" + + "\030\001 \001(\tB6\340A\002\372A0\n.networksecurity.googleap" + + "is.com/ServerTlsPolicyB\366\001\n#com.google.cl" + + "oud.networksecurity.v1B\024ServerTlsPolicyP" + + "rotoP\001ZNgoogle.golang.org/genproto/googl" + + "eapis/cloud/networksecurity/v1;networkse" + + "curity\252\002\037Google.Cloud.NetworkSecurity.V1" + + "\312\002\037Google\\Cloud\\NetworkSecurity\\V1\352\002\"Goo" + + "gle::Cloud::NetworkSecurity::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.networksecurity.v1.TlsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor, + new java.lang.String[] { + "Name", + "Description", + "CreateTime", + "UpdateTime", + "Labels", + "AllowOpen", + "ServerCertificate", + "MtlsPolicy", + }); + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_descriptor = + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_MTLSPolicy_descriptor, + new java.lang.String[] { + "ClientValidationCa", + }); + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ServerTlsPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ListServerTlsPoliciesResponse_descriptor, + new java.lang.String[] { + "ServerTlsPolicies", "NextPageToken", + }); + internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_GetServerTlsPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_CreateServerTlsPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", "ServerTlsPolicyId", "ServerTlsPolicy", + }); + internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "ServerTlsPolicy", + }); + internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_DeleteServerTlsPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.networksecurity.v1.TlsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/TlsProto.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/TlsProto.java new file mode 100644 index 00000000..97115bdd --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/TlsProto.java @@ -0,0 +1,125 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +public final class TlsProto { + private TlsProto() {} + + 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_cloud_networksecurity_v1_GrpcEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_ValidationCA_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_ValidationCA_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networksecurity_v1_CertificateProvider_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networksecurity_v1_CertificateProvider_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)google/cloud/networksecurity/v1/tls.pr" + + "oto\022\037google.cloud.networksecurity.v1\032\037go" + + "ogle/api/field_behavior.proto\"\'\n\014GrpcEnd" + + "point\022\027\n\ntarget_uri\030\001 \001(\tB\003\340A\002\"\305\001\n\014Valid" + + "ationCA\022F\n\rgrpc_endpoint\030\002 \001(\0132-.google." + + "cloud.networksecurity.v1.GrpcEndpointH\000\022" + + "e\n\035certificate_provider_instance\030\003 \001(\0132<" + + ".google.cloud.networksecurity.v1.Certifi" + + "cateProviderInstanceH\000B\006\n\004type\";\n\033Certif" + + "icateProviderInstance\022\034\n\017plugin_instance" + + "\030\001 \001(\tB\003\340A\002\"\314\001\n\023CertificateProvider\022F\n\rg" + + "rpc_endpoint\030\002 \001(\0132-.google.cloud.networ" + + "ksecurity.v1.GrpcEndpointH\000\022e\n\035certifica" + + "te_provider_instance\030\003 \001(\0132<.google.clou" + + "d.networksecurity.v1.CertificateProvider" + + "InstanceH\000B\006\n\004typeB\352\001\n#com.google.cloud." + + "networksecurity.v1B\010TlsProtoP\001ZNgoogle.g" + + "olang.org/genproto/googleapis/cloud/netw" + + "orksecurity/v1;networksecurity\252\002\037Google." + + "Cloud.NetworkSecurity.V1\312\002\037Google\\Cloud\\" + + "NetworkSecurity\\V1\352\002\"Google::Cloud::Netw" + + "orkSecurity::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_GrpcEndpoint_descriptor, + new java.lang.String[] { + "TargetUri", + }); + internal_static_google_cloud_networksecurity_v1_ValidationCA_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_networksecurity_v1_ValidationCA_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_ValidationCA_descriptor, + new java.lang.String[] { + "GrpcEndpoint", "CertificateProviderInstance", "Type", + }); + internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_CertificateProviderInstance_descriptor, + new java.lang.String[] { + "PluginInstance", + }); + internal_static_google_cloud_networksecurity_v1_CertificateProvider_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_networksecurity_v1_CertificateProvider_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networksecurity_v1_CertificateProvider_descriptor, + new java.lang.String[] { + "GrpcEndpoint", "CertificateProviderInstance", "Type", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequest.java new file mode 100644 index 00000000..bdccb634 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequest.java @@ -0,0 +1,1112 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by the UpdateAuthorizationPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest} + */ +public final class UpdateAuthorizationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) + UpdateAuthorizationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAuthorizationPolicyRequest.newBuilder() to construct. + private UpdateAuthorizationPolicyRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAuthorizationPolicyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAuthorizationPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAuthorizationPolicyRequest( + 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.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder subBuilder = null; + if (authorizationPolicy_ != null) { + subBuilder = authorizationPolicy_.toBuilder(); + } + authorizationPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(authorizationPolicy_); + authorizationPolicy_ = 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.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * AuthorizationPolicy resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * AuthorizationPolicy resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * AuthorizationPolicy resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int AUTHORIZATION_POLICY_FIELD_NUMBER = 2; + private com.google.cloud.networksecurity.v1.AuthorizationPolicy authorizationPolicy_; + /** + * + * + *
+   * Required. Updated AuthorizationPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizationPolicy field is set. + */ + @java.lang.Override + public boolean hasAuthorizationPolicy() { + return authorizationPolicy_ != null; + } + /** + * + * + *
+   * Required. Updated AuthorizationPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizationPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy() { + return authorizationPolicy_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance() + : authorizationPolicy_; + } + /** + * + * + *
+   * Required. Updated AuthorizationPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPolicyOrBuilder() { + return getAuthorizationPolicy(); + } + + 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (authorizationPolicy_ != null) { + output.writeMessage(2, getAuthorizationPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (authorizationPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAuthorizationPolicy()); + } + 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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest other = + (com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasAuthorizationPolicy() != other.hasAuthorizationPolicy()) return false; + if (hasAuthorizationPolicy()) { + if (!getAuthorizationPolicy().equals(other.getAuthorizationPolicy())) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasAuthorizationPolicy()) { + hash = (37 * hash) + AUTHORIZATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest 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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest 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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + 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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest 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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest 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 used by the UpdateAuthorizationPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest.class, + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest.Builder.class); + } + + // Construct using + // com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest.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 (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (authorizationPolicyBuilder_ == null) { + authorizationPolicy_ = null; + } else { + authorizationPolicy_ = null; + authorizationPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.AuthorizationPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateAuthorizationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest build() { + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest result = + new com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (authorizationPolicyBuilder_ == null) { + result.authorizationPolicy_ = authorizationPolicy_; + } else { + result.authorizationPolicy_ = authorizationPolicyBuilder_.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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) { + return mergeFrom( + (com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + .getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasAuthorizationPolicy()) { + mergeAuthorizationPolicy(other.getAuthorizationPolicy()); + } + 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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * AuthorizationPolicy resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networksecurity.v1.AuthorizationPolicy authorizationPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + authorizationPolicyBuilder_; + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizationPolicy field is set. + */ + public boolean hasAuthorizationPolicy() { + return authorizationPolicyBuilder_ != null || authorizationPolicy_ != null; + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizationPolicy. + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy() { + if (authorizationPolicyBuilder_ == null) { + return authorizationPolicy_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance() + : authorizationPolicy_; + } else { + return authorizationPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizationPolicy( + com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorizationPolicy_ = value; + onChanged(); + } else { + authorizationPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAuthorizationPolicy( + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder builderForValue) { + if (authorizationPolicyBuilder_ == null) { + authorizationPolicy_ = builderForValue.build(); + onChanged(); + } else { + authorizationPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAuthorizationPolicy( + com.google.cloud.networksecurity.v1.AuthorizationPolicy value) { + if (authorizationPolicyBuilder_ == null) { + if (authorizationPolicy_ != null) { + authorizationPolicy_ = + com.google.cloud.networksecurity.v1.AuthorizationPolicy.newBuilder( + authorizationPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + authorizationPolicy_ = value; + } + onChanged(); + } else { + authorizationPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAuthorizationPolicy() { + if (authorizationPolicyBuilder_ == null) { + authorizationPolicy_ = null; + onChanged(); + } else { + authorizationPolicy_ = null; + authorizationPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder + getAuthorizationPolicyBuilder() { + + onChanged(); + return getAuthorizationPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPolicyOrBuilder() { + if (authorizationPolicyBuilder_ != null) { + return authorizationPolicyBuilder_.getMessageOrBuilder(); + } else { + return authorizationPolicy_ == null + ? com.google.cloud.networksecurity.v1.AuthorizationPolicy.getDefaultInstance() + : authorizationPolicy_; + } + } + /** + * + * + *
+     * Required. Updated AuthorizationPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder> + getAuthorizationPolicyFieldBuilder() { + if (authorizationPolicyBuilder_ == null) { + authorizationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.AuthorizationPolicy, + com.google.cloud.networksecurity.v1.AuthorizationPolicy.Builder, + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder>( + getAuthorizationPolicy(), getParentForChildren(), isClean()); + authorizationPolicy_ = null; + } + return authorizationPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) + private static final com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAuthorizationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAuthorizationPolicyRequest(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.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequestOrBuilder.java new file mode 100644 index 00000000..b0ec7b74 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateAuthorizationPolicyRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * 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/cloud/networksecurity/v1/authorization_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface UpdateAuthorizationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * AuthorizationPolicy resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * AuthorizationPolicy resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * AuthorizationPolicy resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. Updated AuthorizationPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the authorizationPolicy field is set. + */ + boolean hasAuthorizationPolicy(); + /** + * + * + *
+   * Required. Updated AuthorizationPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The authorizationPolicy. + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicy getAuthorizationPolicy(); + /** + * + * + *
+   * Required. Updated AuthorizationPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.AuthorizationPolicy authorization_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networksecurity.v1.AuthorizationPolicyOrBuilder + getAuthorizationPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequest.java new file mode 100644 index 00000000..184c7e44 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequest.java @@ -0,0 +1,1115 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by UpdateClientTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} + */ +public final class UpdateClientTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + UpdateClientTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateClientTlsPolicyRequest.newBuilder() to construct. + private UpdateClientTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateClientTlsPolicyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateClientTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateClientTlsPolicyRequest( + 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.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder subBuilder = null; + if (clientTlsPolicy_ != null) { + subBuilder = clientTlsPolicy_.toBuilder(); + } + clientTlsPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientTlsPolicy_); + clientTlsPolicy_ = 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.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ClientTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ClientTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ClientTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int CLIENT_TLS_POLICY_FIELD_NUMBER = 2; + private com.google.cloud.networksecurity.v1.ClientTlsPolicy clientTlsPolicy_; + /** + * + * + *
+   * Required. Updated ClientTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientTlsPolicy field is set. + */ + @java.lang.Override + public boolean hasClientTlsPolicy() { + return clientTlsPolicy_ != null; + } + /** + * + * + *
+   * Required. Updated ClientTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientTlsPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy() { + return clientTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance() + : clientTlsPolicy_; + } + /** + * + * + *
+   * Required. Updated ClientTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder + getClientTlsPolicyOrBuilder() { + return getClientTlsPolicy(); + } + + 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (clientTlsPolicy_ != null) { + output.writeMessage(2, getClientTlsPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (clientTlsPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClientTlsPolicy()); + } + 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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasClientTlsPolicy() != other.hasClientTlsPolicy()) return false; + if (hasClientTlsPolicy()) { + if (!getClientTlsPolicy().equals(other.getClientTlsPolicy())) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasClientTlsPolicy()) { + hash = (37 * hash) + CLIENT_TLS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getClientTlsPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest 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 used by UpdateClientTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.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 (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicy_ = null; + } else { + clientTlsPolicy_ = null; + clientTlsPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ClientTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateClientTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (clientTlsPolicyBuilder_ == null) { + result.clientTlsPolicy_ = clientTlsPolicy_; + } else { + result.clientTlsPolicy_ = clientTlsPolicyBuilder_.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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasClientTlsPolicy()) { + mergeClientTlsPolicy(other.getClientTlsPolicy()); + } + 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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ClientTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networksecurity.v1.ClientTlsPolicy clientTlsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder> + clientTlsPolicyBuilder_; + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientTlsPolicy field is set. + */ + public boolean hasClientTlsPolicy() { + return clientTlsPolicyBuilder_ != null || clientTlsPolicy_ != null; + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientTlsPolicy. + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy() { + if (clientTlsPolicyBuilder_ == null) { + return clientTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance() + : clientTlsPolicy_; + } else { + return clientTlsPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setClientTlsPolicy(com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clientTlsPolicy_ = value; + onChanged(); + } else { + clientTlsPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setClientTlsPolicy( + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder builderForValue) { + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicy_ = builderForValue.build(); + onChanged(); + } else { + clientTlsPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeClientTlsPolicy(com.google.cloud.networksecurity.v1.ClientTlsPolicy value) { + if (clientTlsPolicyBuilder_ == null) { + if (clientTlsPolicy_ != null) { + clientTlsPolicy_ = + com.google.cloud.networksecurity.v1.ClientTlsPolicy.newBuilder(clientTlsPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + clientTlsPolicy_ = value; + } + onChanged(); + } else { + clientTlsPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearClientTlsPolicy() { + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicy_ = null; + onChanged(); + } else { + clientTlsPolicy_ = null; + clientTlsPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder getClientTlsPolicyBuilder() { + + onChanged(); + return getClientTlsPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder + getClientTlsPolicyOrBuilder() { + if (clientTlsPolicyBuilder_ != null) { + return clientTlsPolicyBuilder_.getMessageOrBuilder(); + } else { + return clientTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ClientTlsPolicy.getDefaultInstance() + : clientTlsPolicy_; + } + } + /** + * + * + *
+     * Required. Updated ClientTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder> + getClientTlsPolicyFieldBuilder() { + if (clientTlsPolicyBuilder_ == null) { + clientTlsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ClientTlsPolicy, + com.google.cloud.networksecurity.v1.ClientTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder>( + getClientTlsPolicy(), getParentForChildren(), isClean()); + clientTlsPolicy_ = null; + } + return clientTlsPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateClientTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateClientTlsPolicyRequest(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.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..6563573b --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateClientTlsPolicyRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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/cloud/networksecurity/v1/client_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface UpdateClientTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ClientTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ClientTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ClientTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. Updated ClientTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the clientTlsPolicy field is set. + */ + boolean hasClientTlsPolicy(); + /** + * + * + *
+   * Required. Updated ClientTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The clientTlsPolicy. + */ + com.google.cloud.networksecurity.v1.ClientTlsPolicy getClientTlsPolicy(); + /** + * + * + *
+   * Required. Updated ClientTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ClientTlsPolicy client_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networksecurity.v1.ClientTlsPolicyOrBuilder getClientTlsPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequest.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequest.java new file mode 100644 index 00000000..203c52f8 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequest.java @@ -0,0 +1,1115 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Request used by UpdateServerTlsPolicy method.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} + */ +public final class UpdateServerTlsPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + UpdateServerTlsPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateServerTlsPolicyRequest.newBuilder() to construct. + private UpdateServerTlsPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateServerTlsPolicyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateServerTlsPolicyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateServerTlsPolicyRequest( + 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.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder subBuilder = null; + if (serverTlsPolicy_ != null) { + subBuilder = serverTlsPolicy_.toBuilder(); + } + serverTlsPolicy_ = + input.readMessage( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serverTlsPolicy_); + serverTlsPolicy_ = 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.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ServerTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ServerTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ServerTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int SERVER_TLS_POLICY_FIELD_NUMBER = 2; + private com.google.cloud.networksecurity.v1.ServerTlsPolicy serverTlsPolicy_; + /** + * + * + *
+   * Required. Updated ServerTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the serverTlsPolicy field is set. + */ + @java.lang.Override + public boolean hasServerTlsPolicy() { + return serverTlsPolicy_ != null; + } + /** + * + * + *
+   * Required. Updated ServerTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serverTlsPolicy. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy() { + return serverTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance() + : serverTlsPolicy_; + } + /** + * + * + *
+   * Required. Updated ServerTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder + getServerTlsPolicyOrBuilder() { + return getServerTlsPolicy(); + } + + 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (serverTlsPolicy_ != null) { + output.writeMessage(2, getServerTlsPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (serverTlsPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServerTlsPolicy()); + } + 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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest other = + (com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasServerTlsPolicy() != other.hasServerTlsPolicy()) return false; + if (hasServerTlsPolicy()) { + if (!getServerTlsPolicy().equals(other.getServerTlsPolicy())) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasServerTlsPolicy()) { + hash = (37 * hash) + SERVER_TLS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getServerTlsPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest 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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest 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 used by UpdateServerTlsPolicy method.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.class, + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.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 (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicy_ = null; + } else { + serverTlsPolicy_ = null; + serverTlsPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.ServerTlsPolicyProto + .internal_static_google_cloud_networksecurity_v1_UpdateServerTlsPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest build() { + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest buildPartial() { + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest result = + new com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (serverTlsPolicyBuilder_ == null) { + result.serverTlsPolicy_ = serverTlsPolicy_; + } else { + result.serverTlsPolicy_ = serverTlsPolicyBuilder_.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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) { + return mergeFrom((com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest other) { + if (other + == com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasServerTlsPolicy()) { + mergeServerTlsPolicy(other.getServerTlsPolicy()); + } + 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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * ServerTlsPolicy resource by the update.  The fields
+     * specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the
+     * mask. If the user does not provide a mask then all fields will be
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networksecurity.v1.ServerTlsPolicy serverTlsPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder> + serverTlsPolicyBuilder_; + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the serverTlsPolicy field is set. + */ + public boolean hasServerTlsPolicy() { + return serverTlsPolicyBuilder_ != null || serverTlsPolicy_ != null; + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serverTlsPolicy. + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy() { + if (serverTlsPolicyBuilder_ == null) { + return serverTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance() + : serverTlsPolicy_; + } else { + return serverTlsPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServerTlsPolicy(com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverTlsPolicy_ = value; + onChanged(); + } else { + serverTlsPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setServerTlsPolicy( + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder builderForValue) { + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicy_ = builderForValue.build(); + onChanged(); + } else { + serverTlsPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeServerTlsPolicy(com.google.cloud.networksecurity.v1.ServerTlsPolicy value) { + if (serverTlsPolicyBuilder_ == null) { + if (serverTlsPolicy_ != null) { + serverTlsPolicy_ = + com.google.cloud.networksecurity.v1.ServerTlsPolicy.newBuilder(serverTlsPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + serverTlsPolicy_ = value; + } + onChanged(); + } else { + serverTlsPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearServerTlsPolicy() { + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicy_ = null; + onChanged(); + } else { + serverTlsPolicy_ = null; + serverTlsPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder getServerTlsPolicyBuilder() { + + onChanged(); + return getServerTlsPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder + getServerTlsPolicyOrBuilder() { + if (serverTlsPolicyBuilder_ != null) { + return serverTlsPolicyBuilder_.getMessageOrBuilder(); + } else { + return serverTlsPolicy_ == null + ? com.google.cloud.networksecurity.v1.ServerTlsPolicy.getDefaultInstance() + : serverTlsPolicy_; + } + } + /** + * + * + *
+     * Required. Updated ServerTlsPolicy resource.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder> + getServerTlsPolicyFieldBuilder() { + if (serverTlsPolicyBuilder_ == null) { + serverTlsPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.ServerTlsPolicy, + com.google.cloud.networksecurity.v1.ServerTlsPolicy.Builder, + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder>( + getServerTlsPolicy(), getParentForChildren(), isClean()); + serverTlsPolicy_ = null; + } + return serverTlsPolicyBuilder_; + } + + @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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + private static final com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest(); + } + + public static com.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateServerTlsPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateServerTlsPolicyRequest(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.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequestOrBuilder.java new file mode 100644 index 00000000..78314da0 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/UpdateServerTlsPolicyRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * 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/cloud/networksecurity/v1/server_tls_policy.proto + +package com.google.cloud.networksecurity.v1; + +public interface UpdateServerTlsPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ServerTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ServerTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * ServerTlsPolicy resource by the update.  The fields
+   * specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the
+   * mask. If the user does not provide a mask then all fields will be
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. Updated ServerTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the serverTlsPolicy field is set. + */ + boolean hasServerTlsPolicy(); + /** + * + * + *
+   * Required. Updated ServerTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serverTlsPolicy. + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicy getServerTlsPolicy(); + /** + * + * + *
+   * Required. Updated ServerTlsPolicy resource.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networksecurity.v1.ServerTlsPolicyOrBuilder getServerTlsPolicyOrBuilder(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCA.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCA.java new file mode 100644 index 00000000..734ab616 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCA.java @@ -0,0 +1,1223 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +/** + * + * + *
+ * Specification of ValidationCA. Defines the mechanism to obtain the
+ * Certificate Authority certificate to validate the peer certificate.
+ * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ValidationCA} + */ +public final class ValidationCA extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networksecurity.v1.ValidationCA) + ValidationCAOrBuilder { + private static final long serialVersionUID = 0L; + // Use ValidationCA.newBuilder() to construct. + private ValidationCA(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ValidationCA() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ValidationCA(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ValidationCA( + 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 18: + { + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder subBuilder = null; + if (typeCase_ == 2) { + subBuilder = ((com.google.cloud.networksecurity.v1.GrpcEndpoint) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.cloud.networksecurity.v1.GrpcEndpoint.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.networksecurity.v1.GrpcEndpoint) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 2; + break; + } + case 26: + { + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder subBuilder = + null; + if (typeCase_ == 3) { + subBuilder = + ((com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_) + .toBuilder(); + } + type_ = + input.readMessage( + com.google.cloud.networksecurity.v1.CertificateProviderInstance.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 3; + 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.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_ValidationCA_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_ValidationCA_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ValidationCA.class, + com.google.cloud.networksecurity.v1.ValidationCA.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public enum TypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GRPC_ENDPOINT(2), + CERTIFICATE_PROVIDER_INSTANCE(3), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(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 TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 2: + return GRPC_ENDPOINT; + case 3: + return CERTIFICATE_PROVIDER_INSTANCE; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int GRPC_ENDPOINT_FIELD_NUMBER = 2; + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the CA certificate.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return Whether the grpcEndpoint field is set. + */ + @java.lang.Override + public boolean hasGrpcEndpoint() { + return typeCase_ == 2; + } + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the CA certificate.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return The grpcEndpoint. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint getGrpcEndpoint() { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the CA certificate.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder getGrpcEndpointOrBuilder() { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + + public static final int CERTIFICATE_PROVIDER_INSTANCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return Whether the certificateProviderInstance field is set. + */ + @java.lang.Override + public boolean hasCertificateProviderInstance() { + return typeCase_ == 3; + } + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return The certificateProviderInstance. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance + getCertificateProviderInstance() { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder + getCertificateProviderInstanceOrBuilder() { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + + 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 (typeCase_ == 2) { + output.writeMessage(2, (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_); + } + if (typeCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_); + } + if (typeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_); + } + 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.cloud.networksecurity.v1.ValidationCA)) { + return super.equals(obj); + } + com.google.cloud.networksecurity.v1.ValidationCA other = + (com.google.cloud.networksecurity.v1.ValidationCA) obj; + + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 2: + if (!getGrpcEndpoint().equals(other.getGrpcEndpoint())) return false; + break; + case 3: + if (!getCertificateProviderInstance().equals(other.getCertificateProviderInstance())) + 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(); + switch (typeCase_) { + case 2: + hash = (37 * hash) + GRPC_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getGrpcEndpoint().hashCode(); + break; + case 3: + hash = (37 * hash) + CERTIFICATE_PROVIDER_INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getCertificateProviderInstance().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networksecurity.v1.ValidationCA parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA 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.cloud.networksecurity.v1.ValidationCA parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA 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.cloud.networksecurity.v1.ValidationCA parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA 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.cloud.networksecurity.v1.ValidationCA parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA 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.cloud.networksecurity.v1.ValidationCA 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; + } + /** + * + * + *
+   * Specification of ValidationCA. Defines the mechanism to obtain the
+   * Certificate Authority certificate to validate the peer certificate.
+   * 
+ * + * Protobuf type {@code google.cloud.networksecurity.v1.ValidationCA} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networksecurity.v1.ValidationCA) + com.google.cloud.networksecurity.v1.ValidationCAOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_ValidationCA_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_ValidationCA_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networksecurity.v1.ValidationCA.class, + com.google.cloud.networksecurity.v1.ValidationCA.Builder.class); + } + + // Construct using com.google.cloud.networksecurity.v1.ValidationCA.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(); + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networksecurity.v1.TlsProto + .internal_static_google_cloud_networksecurity_v1_ValidationCA_descriptor; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCA getDefaultInstanceForType() { + return com.google.cloud.networksecurity.v1.ValidationCA.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCA build() { + com.google.cloud.networksecurity.v1.ValidationCA result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networksecurity.v1.ValidationCA buildPartial() { + com.google.cloud.networksecurity.v1.ValidationCA result = + new com.google.cloud.networksecurity.v1.ValidationCA(this); + if (typeCase_ == 2) { + if (grpcEndpointBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = grpcEndpointBuilder_.build(); + } + } + if (typeCase_ == 3) { + if (certificateProviderInstanceBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = certificateProviderInstanceBuilder_.build(); + } + } + result.typeCase_ = typeCase_; + 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.cloud.networksecurity.v1.ValidationCA) { + return mergeFrom((com.google.cloud.networksecurity.v1.ValidationCA) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networksecurity.v1.ValidationCA other) { + if (other == com.google.cloud.networksecurity.v1.ValidationCA.getDefaultInstance()) + return this; + switch (other.getTypeCase()) { + case GRPC_ENDPOINT: + { + mergeGrpcEndpoint(other.getGrpcEndpoint()); + break; + } + case CERTIFICATE_PROVIDER_INSTANCE: + { + mergeCertificateProviderInstance(other.getCertificateProviderInstance()); + break; + } + case TYPE_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.cloud.networksecurity.v1.ValidationCA parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.networksecurity.v1.ValidationCA) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.GrpcEndpoint, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder, + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder> + grpcEndpointBuilder_; + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return Whether the grpcEndpoint field is set. + */ + @java.lang.Override + public boolean hasGrpcEndpoint() { + return typeCase_ == 2; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return The grpcEndpoint. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpoint getGrpcEndpoint() { + if (grpcEndpointBuilder_ == null) { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } else { + if (typeCase_ == 2) { + return grpcEndpointBuilder_.getMessage(); + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder setGrpcEndpoint(com.google.cloud.networksecurity.v1.GrpcEndpoint value) { + if (grpcEndpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + grpcEndpointBuilder_.setMessage(value); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder setGrpcEndpoint( + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder builderForValue) { + if (grpcEndpointBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + grpcEndpointBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder mergeGrpcEndpoint(com.google.cloud.networksecurity.v1.GrpcEndpoint value) { + if (grpcEndpointBuilder_ == null) { + if (typeCase_ == 2 + && type_ != com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance()) { + type_ = + com.google.cloud.networksecurity.v1.GrpcEndpoint.newBuilder( + (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 2) { + grpcEndpointBuilder_.mergeFrom(value); + } else { + grpcEndpointBuilder_.setMessage(value); + } + } + typeCase_ = 2; + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public Builder clearGrpcEndpoint() { + if (grpcEndpointBuilder_ == null) { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + } + grpcEndpointBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + public com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder getGrpcEndpointBuilder() { + return getGrpcEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder getGrpcEndpointOrBuilder() { + if ((typeCase_ == 2) && (grpcEndpointBuilder_ != null)) { + return grpcEndpointBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 2) { + return (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_; + } + return com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + } + /** + * + * + *
+     * gRPC specific configuration to access the gRPC server to
+     * obtain the CA certificate.
+     * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.GrpcEndpoint, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder, + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder> + getGrpcEndpointFieldBuilder() { + if (grpcEndpointBuilder_ == null) { + if (!(typeCase_ == 2)) { + type_ = com.google.cloud.networksecurity.v1.GrpcEndpoint.getDefaultInstance(); + } + grpcEndpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.GrpcEndpoint, + com.google.cloud.networksecurity.v1.GrpcEndpoint.Builder, + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder>( + (com.google.cloud.networksecurity.v1.GrpcEndpoint) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 2; + onChanged(); + ; + return grpcEndpointBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProviderInstance, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder> + certificateProviderInstanceBuilder_; + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return Whether the certificateProviderInstance field is set. + */ + @java.lang.Override + public boolean hasCertificateProviderInstance() { + return typeCase_ == 3; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return The certificateProviderInstance. + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstance + getCertificateProviderInstance() { + if (certificateProviderInstanceBuilder_ == null) { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } else { + if (typeCase_ == 3) { + return certificateProviderInstanceBuilder_.getMessage(); + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder setCertificateProviderInstance( + com.google.cloud.networksecurity.v1.CertificateProviderInstance value) { + if (certificateProviderInstanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + certificateProviderInstanceBuilder_.setMessage(value); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder setCertificateProviderInstance( + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder builderForValue) { + if (certificateProviderInstanceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + certificateProviderInstanceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder mergeCertificateProviderInstance( + com.google.cloud.networksecurity.v1.CertificateProviderInstance value) { + if (certificateProviderInstanceBuilder_ == null) { + if (typeCase_ == 3 + && type_ + != com.google.cloud.networksecurity.v1.CertificateProviderInstance + .getDefaultInstance()) { + type_ = + com.google.cloud.networksecurity.v1.CertificateProviderInstance.newBuilder( + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 3) { + certificateProviderInstanceBuilder_.mergeFrom(value); + } else { + certificateProviderInstanceBuilder_.setMessage(value); + } + } + typeCase_ = 3; + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public Builder clearCertificateProviderInstance() { + if (certificateProviderInstanceBuilder_ == null) { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + } + certificateProviderInstanceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + public com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder + getCertificateProviderInstanceBuilder() { + return getCertificateProviderInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + @java.lang.Override + public com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder + getCertificateProviderInstanceOrBuilder() { + if ((typeCase_ == 3) && (certificateProviderInstanceBuilder_ != null)) { + return certificateProviderInstanceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 3) { + return (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_; + } + return com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + } + /** + * + * + *
+     * The certificate provider instance specification that will be passed to
+     * the data plane, which will be used to load necessary credential
+     * information.
+     * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProviderInstance, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder> + getCertificateProviderInstanceFieldBuilder() { + if (certificateProviderInstanceBuilder_ == null) { + if (!(typeCase_ == 3)) { + type_ = + com.google.cloud.networksecurity.v1.CertificateProviderInstance.getDefaultInstance(); + } + certificateProviderInstanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networksecurity.v1.CertificateProviderInstance, + com.google.cloud.networksecurity.v1.CertificateProviderInstance.Builder, + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder>( + (com.google.cloud.networksecurity.v1.CertificateProviderInstance) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 3; + onChanged(); + ; + return certificateProviderInstanceBuilder_; + } + + @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.cloud.networksecurity.v1.ValidationCA) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networksecurity.v1.ValidationCA) + private static final com.google.cloud.networksecurity.v1.ValidationCA DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networksecurity.v1.ValidationCA(); + } + + public static com.google.cloud.networksecurity.v1.ValidationCA getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValidationCA parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValidationCA(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.cloud.networksecurity.v1.ValidationCA getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCAOrBuilder.java b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCAOrBuilder.java new file mode 100644 index 00000000..6d2d2d80 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/java/com/google/cloud/networksecurity/v1/ValidationCAOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/cloud/networksecurity/v1/tls.proto + +package com.google.cloud.networksecurity.v1; + +public interface ValidationCAOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1.ValidationCA) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the CA certificate.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return Whether the grpcEndpoint field is set. + */ + boolean hasGrpcEndpoint(); + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the CA certificate.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + * + * @return The grpcEndpoint. + */ + com.google.cloud.networksecurity.v1.GrpcEndpoint getGrpcEndpoint(); + /** + * + * + *
+   * gRPC specific configuration to access the gRPC server to
+   * obtain the CA certificate.
+   * 
+ * + * .google.cloud.networksecurity.v1.GrpcEndpoint grpc_endpoint = 2; + */ + com.google.cloud.networksecurity.v1.GrpcEndpointOrBuilder getGrpcEndpointOrBuilder(); + + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return Whether the certificateProviderInstance field is set. + */ + boolean hasCertificateProviderInstance(); + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + * + * @return The certificateProviderInstance. + */ + com.google.cloud.networksecurity.v1.CertificateProviderInstance getCertificateProviderInstance(); + /** + * + * + *
+   * The certificate provider instance specification that will be passed to
+   * the data plane, which will be used to load necessary credential
+   * information.
+   * 
+ * + * + * .google.cloud.networksecurity.v1.CertificateProviderInstance certificate_provider_instance = 3; + * + */ + com.google.cloud.networksecurity.v1.CertificateProviderInstanceOrBuilder + getCertificateProviderInstanceOrBuilder(); + + public com.google.cloud.networksecurity.v1.ValidationCA.TypeCase getTypeCase(); +} diff --git a/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/authorization_policy.proto b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/authorization_policy.proto new file mode 100644 index 00000000..e66afddd --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/authorization_policy.proto @@ -0,0 +1,249 @@ +// 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.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity"; +option java_multiple_files = true; +option java_outer_classname = "AuthorizationPolicyProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// AuthorizationPolicy is a resource that specifies how a server +// should authorize incoming connections. This resource in itself does +// not change the configuration unless it's attached to a target https +// proxy or endpoint config selector resource. +message AuthorizationPolicy { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + pattern: "projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}" + }; + + // Specification of rules. + message Rule { + // Specification of traffic source attributes. + message Source { + // Optional. List of peer identities to match for authorization. At least one + // principal should match. Each peer can be an exact match, or a prefix + // match (example, "namespace/*") or a suffix match (example, + // "*/service-account") or a presence match "*". Authorization based on + // the principal name without certificate validation (configured by + // ServerTlsPolicy resource) is considered insecure. + repeated string principals = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of CIDR ranges to match based on source IP address. At least one + // IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., + // "1.2.3.0/24") are supported. Authorization based on source IP alone + // should be avoided. The IP addresses of any load balancers or proxies + // should be considered untrusted. + repeated string ip_blocks = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Specification of traffic destination attributes. + message Destination { + // Specification of HTTP header match attributes. + message HttpHeaderMatch { + oneof type { + // Required. The value of the header must match the regular expression + // specified in regexMatch. For regular expression grammar, + // please see: en.cppreference.com/w/cpp/regex/ecmascript + // For matching against a port specified in the HTTP + // request, use a headerMatch with headerName set to Host + // and a regular expression that satisfies the RFC2616 Host + // header's port specifier. + string regex_match = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The name of the HTTP header to match. For matching + // against the HTTP request's authority, use a headerMatch + // with the header name ":authority". For matching a + // request's method, use the headerName ":method". + string header_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. List of host names to match. Matched against the ":authority" header in + // http requests. At least one host should match. Each host can be an + // exact match, or a prefix match (example "mydomain.*") or a suffix + // match (example "*.myorg.com") or a presence (any) match "*". + repeated string hosts = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of destination ports to match. At least one port should match. + repeated uint32 ports = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of HTTP methods to match. At least one method should + // match. Should not be set for gRPC services. + repeated string methods = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Match against key:value pair in http header. Provides a flexible match + // based on HTTP headers, for potentially advanced use cases. At least one + // header should match. Avoid using header matches to make authorization + // decisions unless there is a strong guarantee that requests arrive + // through a trusted client or proxy. + HttpHeaderMatch http_header_match = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. List of attributes for the traffic source. All of the sources must match. + // A source is a match if both principals and ip_blocks match. If not set, + // the action specified in the 'action' field will be applied without any + // rule checks for the source. + repeated Source sources = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of attributes for the traffic destination. All of the destinations + // must match. A destination is a match if a request matches all the + // specified hosts, ports, methods and headers. If not set, the + // action specified in the 'action' field will be applied without any rule + // checks for the destination. + repeated Destination destinations = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Possible values that define what action to take. + enum Action { + // Default value. + ACTION_UNSPECIFIED = 0; + + // Grant access. + ALLOW = 1; + + // Deny access. + // Deny rules should be avoided unless they are used to provide a default + // "deny all" fallback. + DENY = 2; + } + + // Required. Name of the AuthorizationPolicy resource. It matches pattern + // `projects/{project}/locations/{location}/authorizationPolicies/`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Free-text description of the resource. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the AuthorizationPolicy resource. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The action to take when a rule match is found. Possible values + // are "ALLOW" or "DENY". + Action action = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of rules to match. Note that at least one of the rules must match in + // order for the action specified in the 'action' field to be taken. A rule is + // a match if there is a matching source and destination. If left blank, the + // action specified in the `action` field will be applied on every request. + repeated Rule rules = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used with the ListAuthorizationPolicies method. +message ListAuthorizationPoliciesRequest { + // Required. The project and location from which the AuthorizationPolicies + // should be listed, specified in the format + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of AuthorizationPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last + // `ListAuthorizationPoliciesResponse` Indicates that this is a + // continuation of a prior `ListAuthorizationPolicies` call, and + // that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListAuthorizationPolicies method. +message ListAuthorizationPoliciesResponse { + // List of AuthorizationPolicies resources. + repeated AuthorizationPolicy authorization_policies = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetAuthorizationPolicy method. +message GetAuthorizationPolicyRequest { + // Required. A name of the AuthorizationPolicy to get. Must be in the format + // `projects/{project}/locations/{location}/authorizationPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + } + ]; +} + +// Request used by the CreateAuthorizationPolicy method. +message CreateAuthorizationPolicyRequest { + // Required. The parent resource of the AuthorizationPolicy. Must be in the + // format `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/AuthorizationPolicy" + } + ]; + + // Required. Short name of the AuthorizationPolicy resource to be created. + // This value should be 1-63 characters long, containing only + // letters, numbers, hyphens, and underscores, and should not start + // with a number. E.g. "authz_policy". + string authorization_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. AuthorizationPolicy resource to be created. + AuthorizationPolicy authorization_policy = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateAuthorizationPolicy method. +message UpdateAuthorizationPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // AuthorizationPolicy resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated AuthorizationPolicy resource. + AuthorizationPolicy authorization_policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteAuthorizationPolicy method. +message DeleteAuthorizationPolicyRequest { + // Required. A name of the AuthorizationPolicy to delete. Must be in the format + // `projects/{project}/locations/{location}/authorizationPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + } + ]; +} diff --git a/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/client_tls_policy.proto b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/client_tls_policy.proto new file mode 100644 index 00000000..4cba3efa --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/client_tls_policy.proto @@ -0,0 +1,160 @@ +// 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.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/tls.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity"; +option java_multiple_files = true; +option java_outer_classname = "ClientTlsPolicyProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// ClientTlsPolicy is a resource that specifies how a client should authenticate +// connections to backends of a service. This resource itself does not affect +// configuration unless it is attached to a backend service resource. +message ClientTlsPolicy { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + pattern: "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}" + }; + + // Required. Name of the ClientTlsPolicy resource. It matches the pattern + // `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Free-text description of the resource. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the resource. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Server Name Indication string to present to the server during TLS + // handshake. E.g: "secure.example.com". + string sni = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines a mechanism to provision client identity (public and private keys) + // for peer to peer authentication. The presence of this dictates mTLS. + CertificateProvider client_certificate = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the mechanism to obtain the Certificate Authority certificate to + // validate the server certificate. If empty, client does not validate the + // server certificate. + repeated ValidationCA server_validation_ca = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used by the ListClientTlsPolicies method. +message ListClientTlsPoliciesRequest { + // Required. The project and location from which the ClientTlsPolicies should + // be listed, specified in the format `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of ClientTlsPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last `ListClientTlsPoliciesResponse` + // Indicates that this is a continuation of a prior + // `ListClientTlsPolicies` call, and that the system + // should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListClientTlsPolicies method. +message ListClientTlsPoliciesResponse { + // List of ClientTlsPolicy resources. + repeated ClientTlsPolicy client_tls_policies = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetClientTlsPolicy method. +message GetClientTlsPolicyRequest { + // Required. A name of the ClientTlsPolicy to get. Must be in the format + // `projects/*/locations/{location}/clientTlsPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + } + ]; +} + +// Request used by the CreateClientTlsPolicy method. +message CreateClientTlsPolicyRequest { + // Required. The parent resource of the ClientTlsPolicy. Must be in + // the format `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/ClientTlsPolicy" + } + ]; + + // Required. Short name of the ClientTlsPolicy resource to be created. This value should + // be 1-63 characters long, containing only letters, numbers, hyphens, and + // underscores, and should not start with a number. E.g. "client_mtls_policy". + string client_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. ClientTlsPolicy resource to be created. + ClientTlsPolicy client_tls_policy = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by UpdateClientTlsPolicy method. +message UpdateClientTlsPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // ClientTlsPolicy resource by the update. The fields + // specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the + // mask. If the user does not provide a mask then all fields will be + // overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated ClientTlsPolicy resource. + ClientTlsPolicy client_tls_policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteClientTlsPolicy method. +message DeleteClientTlsPolicyRequest { + // Required. A name of the ClientTlsPolicy to delete. Must be in + // the format `projects/*/locations/{location}/clientTlsPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + } + ]; +} diff --git a/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/common.proto b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/common.proto new file mode 100644 index 00000000..1ec1905b --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/common.proto @@ -0,0 +1,55 @@ +// 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.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/network_security.proto b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/network_security.proto new file mode 100644 index 00000000..addce1e1 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/network_security.proto @@ -0,0 +1,201 @@ +// 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.cloud.networksecurity.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/networksecurity/v1/authorization_policy.proto"; +import "google/cloud/networksecurity/v1/client_tls_policy.proto"; +import "google/cloud/networksecurity/v1/server_tls_policy.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity"; +option java_multiple_files = true; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// Network Security API provides resources to configure authentication and +// authorization policies. Refer to per API resource documentation for more +// information. +service NetworkSecurity { + option (google.api.default_host) = "networksecurity.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists AuthorizationPolicies in a given project and location. + rpc ListAuthorizationPolicies(ListAuthorizationPoliciesRequest) returns (ListAuthorizationPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/authorizationPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single AuthorizationPolicy. + rpc GetAuthorizationPolicy(GetAuthorizationPolicyRequest) returns (AuthorizationPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new AuthorizationPolicy in a given project and location. + rpc CreateAuthorizationPolicy(CreateAuthorizationPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/authorizationPolicies" + body: "authorization_policy" + }; + option (google.api.method_signature) = "parent,authorization_policy,authorization_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "AuthorizationPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single AuthorizationPolicy. + rpc UpdateAuthorizationPolicy(UpdateAuthorizationPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{authorization_policy.name=projects/*/locations/*/authorizationPolicies/*}" + body: "authorization_policy" + }; + option (google.api.method_signature) = "authorization_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AuthorizationPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single AuthorizationPolicy. + rpc DeleteAuthorizationPolicy(DeleteAuthorizationPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists ServerTlsPolicies in a given project and location. + rpc ListServerTlsPolicies(ListServerTlsPoliciesRequest) returns (ListServerTlsPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/serverTlsPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ServerTlsPolicy. + rpc GetServerTlsPolicy(GetServerTlsPolicyRequest) returns (ServerTlsPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new ServerTlsPolicy in a given project and location. + rpc CreateServerTlsPolicy(CreateServerTlsPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/serverTlsPolicies" + body: "server_tls_policy" + }; + option (google.api.method_signature) = "parent,server_tls_policy,server_tls_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "ServerTlsPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single ServerTlsPolicy. + rpc UpdateServerTlsPolicy(UpdateServerTlsPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{server_tls_policy.name=projects/*/locations/*/serverTlsPolicies/*}" + body: "server_tls_policy" + }; + option (google.api.method_signature) = "server_tls_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ServerTlsPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single ServerTlsPolicy. + rpc DeleteServerTlsPolicy(DeleteServerTlsPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists ClientTlsPolicies in a given project and location. + rpc ListClientTlsPolicies(ListClientTlsPoliciesRequest) returns (ListClientTlsPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clientTlsPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ClientTlsPolicy. + rpc GetClientTlsPolicy(GetClientTlsPolicyRequest) returns (ClientTlsPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new ClientTlsPolicy in a given project and location. + rpc CreateClientTlsPolicy(CreateClientTlsPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clientTlsPolicies" + body: "client_tls_policy" + }; + option (google.api.method_signature) = "parent,client_tls_policy,client_tls_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "ClientTlsPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single ClientTlsPolicy. + rpc UpdateClientTlsPolicy(UpdateClientTlsPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{client_tls_policy.name=projects/*/locations/*/clientTlsPolicies/*}" + body: "client_tls_policy" + }; + option (google.api.method_signature) = "client_tls_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ClientTlsPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single ClientTlsPolicy. + rpc DeleteClientTlsPolicy(DeleteClientTlsPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } +} diff --git a/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/server_tls_policy.proto b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/server_tls_policy.proto new file mode 100644 index 00000000..fb549068 --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/server_tls_policy.proto @@ -0,0 +1,181 @@ +// 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.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/tls.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity"; +option java_multiple_files = true; +option java_outer_classname = "ServerTlsPolicyProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// ServerTlsPolicy is a resource that specifies how a server should authenticate +// incoming requests. This resource itself does not affect configuration unless +// it is attached to a target https proxy or endpoint config selector resource. +message ServerTlsPolicy { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + pattern: "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}" + }; + + // Specification of the MTLSPolicy. + message MTLSPolicy { + // + // Defines the mechanism to obtain the Certificate Authority certificate to + // validate the client certificate. + repeated ValidationCA client_validation_ca = 1; + } + + // Required. Name of the ServerTlsPolicy resource. It matches the pattern + // `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Free-text description of the resource. + string description = 2; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of label tags associated with the resource. + map labels = 5; + + // + // Determines if server allows plaintext connections. If set to true, server + // allows plain text connections. By default, it is set to false. This setting + // is not exclusive of other encryption modes. For example, if `allow_open` + // and `mtls_policy` are set, server allows both plain text and mTLS + // connections. See documentation of other encryption modes to confirm + // compatibility. + // + // Consider using it if you wish to upgrade in place your deployment to TLS + // while having mixed TLS and non-TLS traffic reaching port :80. + bool allow_open = 6; + + // + // Defines a mechanism to provision server identity (public and private keys). + // Cannot be combined with `allow_open` as a permissive mode that allows both + // plain text and TLS is not supported. + CertificateProvider server_certificate = 7; + + // + // Defines a mechanism to provision peer validation certificates for peer to + // peer authentication (Mutual TLS - mTLS). If not specified, client + // certificate will not be requested. The connection is treated as TLS and not + // mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain + // text and mTLS connections. + MTLSPolicy mtls_policy = 8; +} + +// Request used by the ListServerTlsPolicies method. +message ListServerTlsPoliciesRequest { + // Required. The project and location from which the ServerTlsPolicies should + // be listed, specified in the format `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of ServerTlsPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last `ListServerTlsPoliciesResponse` + // Indicates that this is a continuation of a prior + // `ListServerTlsPolicies` call, and that the system + // should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListServerTlsPolicies method. +message ListServerTlsPoliciesResponse { + // List of ServerTlsPolicy resources. + repeated ServerTlsPolicy server_tls_policies = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetServerTlsPolicy method. +message GetServerTlsPolicyRequest { + // Required. A name of the ServerTlsPolicy to get. Must be in the format + // `projects/*/locations/{location}/serverTlsPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + } + ]; +} + +// Request used by the CreateServerTlsPolicy method. +message CreateServerTlsPolicyRequest { + // Required. The parent resource of the ServerTlsPolicy. Must be in + // the format `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/ServerTlsPolicy" + } + ]; + + // Required. Short name of the ServerTlsPolicy resource to be created. This value should + // be 1-63 characters long, containing only letters, numbers, hyphens, and + // underscores, and should not start with a number. E.g. "server_mtls_policy". + string server_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. ServerTlsPolicy resource to be created. + ServerTlsPolicy server_tls_policy = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by UpdateServerTlsPolicy method. +message UpdateServerTlsPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // ServerTlsPolicy resource by the update. The fields + // specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the + // mask. If the user does not provide a mask then all fields will be + // overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated ServerTlsPolicy resource. + ServerTlsPolicy server_tls_policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteServerTlsPolicy method. +message DeleteServerTlsPolicyRequest { + // Required. A name of the ServerTlsPolicy to delete. Must be in + // the format `projects/*/locations/{location}/serverTlsPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + } + ]; +} diff --git a/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/tls.proto b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/tls.proto new file mode 100644 index 00000000..2b23d8ef --- /dev/null +++ b/proto-google-cloud-network-security-v1/src/main/proto/google/cloud/networksecurity/v1/tls.proto @@ -0,0 +1,78 @@ +// 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.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity"; +option java_multiple_files = true; +option java_outer_classname = "TlsProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// Specification of the GRPC Endpoint. +message GrpcEndpoint { + // Required. The target URI of the gRPC endpoint. Only UDS path is supported, and + // should start with "unix:". + string target_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Specification of ValidationCA. Defines the mechanism to obtain the +// Certificate Authority certificate to validate the peer certificate. +message ValidationCA { + // The type of certificate provider which provides the CA certificate. + oneof type { + // gRPC specific configuration to access the gRPC server to + // obtain the CA certificate. + GrpcEndpoint grpc_endpoint = 2; + + // The certificate provider instance specification that will be passed to + // the data plane, which will be used to load necessary credential + // information. + CertificateProviderInstance certificate_provider_instance = 3; + } +} + +// Specification of a TLS certificate provider instance. Workloads may have one +// or more CertificateProvider instances (plugins) and one of them is enabled +// and configured by specifying this message. Workloads use the values from this +// message to locate and load the CertificateProvider instance configuration. +message CertificateProviderInstance { + // Required. Plugin instance name, used to locate and load CertificateProvider instance + // configuration. Set to "google_cloud_private_spiffe" to use Certificate + // Authority Service certificate provider instance. + string plugin_instance = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Specification of certificate provider. Defines the mechanism to obtain the +// certificate and private key for peer to peer authentication. +message CertificateProvider { + // The type of certificate provider which provides the certificates and + // private keys. + oneof type { + // gRPC specific configuration to access the gRPC server to + // obtain the cert and private key. + GrpcEndpoint grpc_endpoint = 2; + + // The certificate provider instance specification that will be passed to + // the data plane, which will be used to load necessary credential + // information. + CertificateProviderInstance certificate_provider_instance = 3; + } +} diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000..75b43ca5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.NetworkSecuritySettings; +import com.google.cloud.networksecurity.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + NetworkSecuritySettings networkSecuritySettings = + NetworkSecuritySettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + NetworkSecurityClient networkSecurityClient = + NetworkSecurityClient.create(networkSecuritySettings); + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000..da11cdd6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_create_setendpoint_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.NetworkSecuritySettings; +import com.google.cloud.networksecurity.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + NetworkSecuritySettings networkSecuritySettings = + NetworkSecuritySettings.newBuilder().setEndpoint(myEndpoint).build(); + NetworkSecurityClient networkSecurityClient = + NetworkSecurityClient.create(networkSecuritySettings); + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java new file mode 100644 index 00000000..491de0b9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.longrunning.Operation; + +public class AsyncCreateAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + asyncCreateAuthorizationPolicy(); + } + + public static void asyncCreateAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateAuthorizationPolicyRequest request = + CreateAuthorizationPolicyRequest.newBuilder() + .setParent( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setAuthorizationPolicyId("authorizationPolicyId1314252166") + .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) + .build(); + ApiFuture future = + networkSecurityClient.createAuthorizationPolicyCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java new file mode 100644 index 00000000..68a87363 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java @@ -0,0 +1,52 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; + +public class AsyncCreateAuthorizationPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncCreateAuthorizationPolicyLRO(); + } + + public static void asyncCreateAuthorizationPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateAuthorizationPolicyRequest request = + CreateAuthorizationPolicyRequest.newBuilder() + .setParent( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setAuthorizationPolicyId("authorizationPolicyId1314252166") + .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) + .build(); + OperationFuture future = + networkSecurityClient.createAuthorizationPolicyOperationCallable().futureCall(request); + // Do something. + AuthorizationPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java new file mode 100644 index 00000000..d1c6244f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java @@ -0,0 +1,48 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncCreateAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + syncCreateAuthorizationPolicy(); + } + + public static void syncCreateAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateAuthorizationPolicyRequest request = + CreateAuthorizationPolicyRequest.newBuilder() + .setParent( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setAuthorizationPolicyId("authorizationPolicyId1314252166") + .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) + .build(); + AuthorizationPolicy response = + networkSecurityClient.createAuthorizationPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java new file mode 100644 index 00000000..e6bacdff --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java @@ -0,0 +1,46 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_authorizationpolicynameauthorizationpolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString { + + public static void main(String[] args) throws Exception { + syncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString(); + } + + public static void syncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + AuthorizationPolicyName parent = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + AuthorizationPolicy response = + networkSecurityClient + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_authorizationpolicynameauthorizationpolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java new file mode 100644 index 00000000..9a6ac78c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java @@ -0,0 +1,47 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_stringauthorizationpolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncCreateAuthorizationPolicyStringAuthorizationpolicyString { + + public static void main(String[] args) throws Exception { + syncCreateAuthorizationPolicyStringAuthorizationpolicyString(); + } + + public static void syncCreateAuthorizationPolicyStringAuthorizationpolicyString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String parent = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString(); + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + AuthorizationPolicy response = + networkSecurityClient + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_stringauthorizationpolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java new file mode 100644 index 00000000..a48741df --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.longrunning.Operation; + +public class AsyncCreateClientTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncCreateClientTlsPolicy(); + } + + public static void asyncCreateClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateClientTlsPolicyRequest request = + CreateClientTlsPolicyRequest.newBuilder() + .setParent( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .setClientTlsPolicyId("clientTlsPolicyId-188933315") + .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) + .build(); + ApiFuture future = + networkSecurityClient.createClientTlsPolicyCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java new file mode 100644 index 00000000..69b8176c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java @@ -0,0 +1,52 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; + +public class AsyncCreateClientTlsPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncCreateClientTlsPolicyLRO(); + } + + public static void asyncCreateClientTlsPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateClientTlsPolicyRequest request = + CreateClientTlsPolicyRequest.newBuilder() + .setParent( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .setClientTlsPolicyId("clientTlsPolicyId-188933315") + .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) + .build(); + OperationFuture future = + networkSecurityClient.createClientTlsPolicyOperationCallable().futureCall(request); + // Do something. + ClientTlsPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java new file mode 100644 index 00000000..21e917d1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncCreateClientTlsPolicy { + + public static void main(String[] args) throws Exception { + syncCreateClientTlsPolicy(); + } + + public static void syncCreateClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateClientTlsPolicyRequest request = + CreateClientTlsPolicyRequest.newBuilder() + .setParent( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .setClientTlsPolicyId("clientTlsPolicyId-188933315") + .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) + .build(); + ClientTlsPolicy response = networkSecurityClient.createClientTlsPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java new file mode 100644 index 00000000..eb78ff27 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java @@ -0,0 +1,46 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_clienttlspolicynameclienttlspolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString { + + public static void main(String[] args) throws Exception { + syncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString(); + } + + public static void syncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ClientTlsPolicyName parent = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + ClientTlsPolicy response = + networkSecurityClient + .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_clienttlspolicynameclienttlspolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java new file mode 100644 index 00000000..ba6aa2b9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_stringclienttlspolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncCreateClientTlsPolicyStringClienttlspolicyString { + + public static void main(String[] args) throws Exception { + syncCreateClientTlsPolicyStringClienttlspolicyString(); + } + + public static void syncCreateClientTlsPolicyStringClienttlspolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String parent = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + ClientTlsPolicy response = + networkSecurityClient + .createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_stringclienttlspolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java new file mode 100644 index 00000000..50130540 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; +import com.google.longrunning.Operation; + +public class AsyncCreateServerTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncCreateServerTlsPolicy(); + } + + public static void asyncCreateServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateServerTlsPolicyRequest request = + CreateServerTlsPolicyRequest.newBuilder() + .setParent( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .setServerTlsPolicyId("serverTlsPolicyId-1966046011") + .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) + .build(); + ApiFuture future = + networkSecurityClient.createServerTlsPolicyCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java new file mode 100644 index 00000000..1c96d17b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java @@ -0,0 +1,52 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class AsyncCreateServerTlsPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncCreateServerTlsPolicyLRO(); + } + + public static void asyncCreateServerTlsPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateServerTlsPolicyRequest request = + CreateServerTlsPolicyRequest.newBuilder() + .setParent( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .setServerTlsPolicyId("serverTlsPolicyId-1966046011") + .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) + .build(); + OperationFuture future = + networkSecurityClient.createServerTlsPolicyOperationCallable().futureCall(request); + // Do something. + ServerTlsPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java new file mode 100644 index 00000000..5aada445 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class SyncCreateServerTlsPolicy { + + public static void main(String[] args) throws Exception { + syncCreateServerTlsPolicy(); + } + + public static void syncCreateServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + CreateServerTlsPolicyRequest request = + CreateServerTlsPolicyRequest.newBuilder() + .setParent( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .setServerTlsPolicyId("serverTlsPolicyId-1966046011") + .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) + .build(); + ServerTlsPolicy response = networkSecurityClient.createServerTlsPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java new file mode 100644 index 00000000..f84fd060 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java @@ -0,0 +1,46 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_servertlspolicynameservertlspolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString { + + public static void main(String[] args) throws Exception { + syncCreateServerTlsPolicyServertlspolicynameServertlspolicyString(); + } + + public static void syncCreateServerTlsPolicyServertlspolicynameServertlspolicyString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ServerTlsPolicyName parent = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + ServerTlsPolicy response = + networkSecurityClient + .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_servertlspolicynameservertlspolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java new file mode 100644 index 00000000..de5873a4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_stringservertlspolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class SyncCreateServerTlsPolicyStringServertlspolicyString { + + public static void main(String[] args) throws Exception { + syncCreateServerTlsPolicyStringServertlspolicyString(); + } + + public static void syncCreateServerTlsPolicyStringServertlspolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String parent = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + ServerTlsPolicy response = + networkSecurityClient + .createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_stringservertlspolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicy.java new file mode 100644 index 00000000..b47623c4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + asyncDeleteAuthorizationPolicy(); + } + + public static void asyncDeleteAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteAuthorizationPolicyRequest request = + DeleteAuthorizationPolicyRequest.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .build(); + ApiFuture future = + networkSecurityClient.deleteAuthorizationPolicyCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicyLRO.java new file mode 100644 index 00000000..bf8636ff --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/AsyncDeleteAuthorizationPolicyLRO.java @@ -0,0 +1,50 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteAuthorizationPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteAuthorizationPolicyLRO(); + } + + public static void asyncDeleteAuthorizationPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteAuthorizationPolicyRequest request = + DeleteAuthorizationPolicyRequest.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .build(); + OperationFuture future = + networkSecurityClient.deleteAuthorizationPolicyOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicy.java new file mode 100644 index 00000000..de48eb00 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + syncDeleteAuthorizationPolicy(); + } + + public static void syncDeleteAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteAuthorizationPolicyRequest request = + DeleteAuthorizationPolicyRequest.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .build(); + networkSecurityClient.deleteAuthorizationPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyAuthorizationpolicyname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyAuthorizationpolicyname.java new file mode 100644 index 00000000..ce548508 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyAuthorizationpolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_authorizationpolicyname_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAuthorizationPolicyAuthorizationpolicyname { + + public static void main(String[] args) throws Exception { + syncDeleteAuthorizationPolicyAuthorizationpolicyname(); + } + + public static void syncDeleteAuthorizationPolicyAuthorizationpolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + networkSecurityClient.deleteAuthorizationPolicyAsync(name).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_authorizationpolicyname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyString.java new file mode 100644 index 00000000..78eac36a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteauthorizationpolicy/SyncDeleteAuthorizationPolicyString.java @@ -0,0 +1,41 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_string_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAuthorizationPolicyString { + + public static void main(String[] args) throws Exception { + syncDeleteAuthorizationPolicyString(); + } + + public static void syncDeleteAuthorizationPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString(); + networkSecurityClient.deleteAuthorizationPolicyAsync(name).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteauthorizationpolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicy.java new file mode 100644 index 00000000..2e56e6ad --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteClientTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncDeleteClientTlsPolicy(); + } + + public static void asyncDeleteClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteClientTlsPolicyRequest request = + DeleteClientTlsPolicyRequest.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .build(); + ApiFuture future = + networkSecurityClient.deleteClientTlsPolicyCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicyLRO.java new file mode 100644 index 00000000..60dbb3b6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/AsyncDeleteClientTlsPolicyLRO.java @@ -0,0 +1,50 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteClientTlsPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteClientTlsPolicyLRO(); + } + + public static void asyncDeleteClientTlsPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteClientTlsPolicyRequest request = + DeleteClientTlsPolicyRequest.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .build(); + OperationFuture future = + networkSecurityClient.deleteClientTlsPolicyOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicy.java new file mode 100644 index 00000000..cf07c342 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.Empty; + +public class SyncDeleteClientTlsPolicy { + + public static void main(String[] args) throws Exception { + syncDeleteClientTlsPolicy(); + } + + public static void syncDeleteClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteClientTlsPolicyRequest request = + DeleteClientTlsPolicyRequest.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .build(); + networkSecurityClient.deleteClientTlsPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyClienttlspolicyname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyClienttlspolicyname.java new file mode 100644 index 00000000..464507ab --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyClienttlspolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_clienttlspolicyname_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.Empty; + +public class SyncDeleteClientTlsPolicyClienttlspolicyname { + + public static void main(String[] args) throws Exception { + syncDeleteClientTlsPolicyClienttlspolicyname(); + } + + public static void syncDeleteClientTlsPolicyClienttlspolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + networkSecurityClient.deleteClientTlsPolicyAsync(name).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_clienttlspolicyname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyString.java new file mode 100644 index 00000000..a0d928f5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteclienttlspolicy/SyncDeleteClientTlsPolicyString.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_string_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.Empty; + +public class SyncDeleteClientTlsPolicyString { + + public static void main(String[] args) throws Exception { + syncDeleteClientTlsPolicyString(); + } + + public static void syncDeleteClientTlsPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); + networkSecurityClient.deleteClientTlsPolicyAsync(name).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteclienttlspolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicy.java new file mode 100644 index 00000000..3c60d793 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; +import com.google.longrunning.Operation; + +public class AsyncDeleteServerTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncDeleteServerTlsPolicy(); + } + + public static void asyncDeleteServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteServerTlsPolicyRequest request = + DeleteServerTlsPolicyRequest.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .build(); + ApiFuture future = + networkSecurityClient.deleteServerTlsPolicyCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicyLRO.java new file mode 100644 index 00000000..f43f1c79 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/AsyncDeleteServerTlsPolicyLRO.java @@ -0,0 +1,50 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; +import com.google.protobuf.Empty; + +public class AsyncDeleteServerTlsPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteServerTlsPolicyLRO(); + } + + public static void asyncDeleteServerTlsPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteServerTlsPolicyRequest request = + DeleteServerTlsPolicyRequest.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .build(); + OperationFuture future = + networkSecurityClient.deleteServerTlsPolicyOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicy.java new file mode 100644 index 00000000..7a2cd5cb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; +import com.google.protobuf.Empty; + +public class SyncDeleteServerTlsPolicy { + + public static void main(String[] args) throws Exception { + syncDeleteServerTlsPolicy(); + } + + public static void syncDeleteServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + DeleteServerTlsPolicyRequest request = + DeleteServerTlsPolicyRequest.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .build(); + networkSecurityClient.deleteServerTlsPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyServertlspolicyname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyServertlspolicyname.java new file mode 100644 index 00000000..9bfe8efd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyServertlspolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_servertlspolicyname_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; +import com.google.protobuf.Empty; + +public class SyncDeleteServerTlsPolicyServertlspolicyname { + + public static void main(String[] args) throws Exception { + syncDeleteServerTlsPolicyServertlspolicyname(); + } + + public static void syncDeleteServerTlsPolicyServertlspolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + networkSecurityClient.deleteServerTlsPolicyAsync(name).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_servertlspolicyname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyString.java new file mode 100644 index 00000000..59605ae3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/deleteservertlspolicy/SyncDeleteServerTlsPolicyString.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_string_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; +import com.google.protobuf.Empty; + +public class SyncDeleteServerTlsPolicyString { + + public static void main(String[] args) throws Exception { + syncDeleteServerTlsPolicyString(); + } + + public static void syncDeleteServerTlsPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); + networkSecurityClient.deleteServerTlsPolicyAsync(name).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_deleteservertlspolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/AsyncGetAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/AsyncGetAuthorizationPolicy.java new file mode 100644 index 00000000..05d54a62 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/AsyncGetAuthorizationPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.GetAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class AsyncGetAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + asyncGetAuthorizationPolicy(); + } + + public static void asyncGetAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetAuthorizationPolicyRequest request = + GetAuthorizationPolicyRequest.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .build(); + ApiFuture future = + networkSecurityClient.getAuthorizationPolicyCallable().futureCall(request); + // Do something. + AuthorizationPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicy.java new file mode 100644 index 00000000..9785908b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.GetAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + syncGetAuthorizationPolicy(); + } + + public static void syncGetAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetAuthorizationPolicyRequest request = + GetAuthorizationPolicyRequest.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .build(); + AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyAuthorizationpolicyname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyAuthorizationpolicyname.java new file mode 100644 index 00000000..a147e190 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyAuthorizationpolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_authorizationpolicyname_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetAuthorizationPolicyAuthorizationpolicyname { + + public static void main(String[] args) throws Exception { + syncGetAuthorizationPolicyAuthorizationpolicyname(); + } + + public static void syncGetAuthorizationPolicyAuthorizationpolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_authorizationpolicyname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyString.java new file mode 100644 index 00000000..b8099aee --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getauthorizationpolicy/SyncGetAuthorizationPolicyString.java @@ -0,0 +1,41 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_string_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetAuthorizationPolicyString { + + public static void main(String[] args) throws Exception { + syncGetAuthorizationPolicyString(); + } + + public static void syncGetAuthorizationPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString(); + AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getauthorizationpolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/AsyncGetClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/AsyncGetClientTlsPolicy.java new file mode 100644 index 00000000..0a46f2ec --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/AsyncGetClientTlsPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.GetClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class AsyncGetClientTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncGetClientTlsPolicy(); + } + + public static void asyncGetClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetClientTlsPolicyRequest request = + GetClientTlsPolicyRequest.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .build(); + ApiFuture future = + networkSecurityClient.getClientTlsPolicyCallable().futureCall(request); + // Do something. + ClientTlsPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicy.java new file mode 100644 index 00000000..97f1f137 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.GetClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetClientTlsPolicy { + + public static void main(String[] args) throws Exception { + syncGetClientTlsPolicy(); + } + + public static void syncGetClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetClientTlsPolicyRequest request = + GetClientTlsPolicyRequest.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .build(); + ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyClienttlspolicyname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyClienttlspolicyname.java new file mode 100644 index 00000000..e79b00f1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyClienttlspolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_clienttlspolicyname_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetClientTlsPolicyClienttlspolicyname { + + public static void main(String[] args) throws Exception { + syncGetClientTlsPolicyClienttlspolicyname(); + } + + public static void syncGetClientTlsPolicyClienttlspolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_clienttlspolicyname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyString.java new file mode 100644 index 00000000..07db8ba6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getclienttlspolicy/SyncGetClientTlsPolicyString.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_string_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetClientTlsPolicyString { + + public static void main(String[] args) throws Exception { + syncGetClientTlsPolicyString(); + } + + public static void syncGetClientTlsPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); + ClientTlsPolicy response = networkSecurityClient.getClientTlsPolicy(name); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getclienttlspolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/AsyncGetServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/AsyncGetServerTlsPolicy.java new file mode 100644 index 00000000..dbf52e3d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/AsyncGetServerTlsPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.GetServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class AsyncGetServerTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncGetServerTlsPolicy(); + } + + public static void asyncGetServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetServerTlsPolicyRequest request = + GetServerTlsPolicyRequest.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .build(); + ApiFuture future = + networkSecurityClient.getServerTlsPolicyCallable().futureCall(request); + // Do something. + ServerTlsPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicy.java new file mode 100644 index 00000000..dfef44c6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.GetServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class SyncGetServerTlsPolicy { + + public static void main(String[] args) throws Exception { + syncGetServerTlsPolicy(); + } + + public static void syncGetServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetServerTlsPolicyRequest request = + GetServerTlsPolicyRequest.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .build(); + ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyServertlspolicyname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyServertlspolicyname.java new file mode 100644 index 00000000..e6e725ab --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyServertlspolicyname.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_servertlspolicyname_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class SyncGetServerTlsPolicyServertlspolicyname { + + public static void main(String[] args) throws Exception { + syncGetServerTlsPolicyServertlspolicyname(); + } + + public static void syncGetServerTlsPolicyServertlspolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_servertlspolicyname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyString.java new file mode 100644 index 00000000..1c202e80 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getservertlspolicy/SyncGetServerTlsPolicyString.java @@ -0,0 +1,40 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_string_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; + +public class SyncGetServerTlsPolicyString { + + public static void main(String[] args) throws Exception { + syncGetServerTlsPolicyString(); + } + + public static void syncGetServerTlsPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); + ServerTlsPolicy response = networkSecurityClient.getServerTlsPolicy(name); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getservertlspolicy_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPolicies.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPolicies.java new file mode 100644 index 00000000..34af8e34 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPolicies.java @@ -0,0 +1,51 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class AsyncListAuthorizationPolicies { + + public static void main(String[] args) throws Exception { + asyncListAuthorizationPolicies(); + } + + public static void asyncListAuthorizationPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListAuthorizationPoliciesRequest request = + ListAuthorizationPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + networkSecurityClient.listAuthorizationPoliciesPagedCallable().futureCall(request); + // Do something. + for (AuthorizationPolicy element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPoliciesPaged.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPoliciesPaged.java new file mode 100644 index 00000000..e78eef58 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/AsyncListAuthorizationPoliciesPaged.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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_paged_async] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.ListAuthorizationPoliciesResponse; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.common.base.Strings; + +public class AsyncListAuthorizationPoliciesPaged { + + public static void main(String[] args) throws Exception { + asyncListAuthorizationPoliciesPaged(); + } + + public static void asyncListAuthorizationPoliciesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListAuthorizationPoliciesRequest request = + ListAuthorizationPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListAuthorizationPoliciesResponse response = + networkSecurityClient.listAuthorizationPoliciesCallable().call(request); + for (AuthorizationPolicy element : response.getAuthorizationPoliciesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPolicies.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPolicies.java new file mode 100644 index 00000000..8db22dd7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPolicies.java @@ -0,0 +1,48 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListAuthorizationPolicies { + + public static void main(String[] args) throws Exception { + syncListAuthorizationPolicies(); + } + + public static void syncListAuthorizationPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListAuthorizationPoliciesRequest request = + ListAuthorizationPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (AuthorizationPolicy element : + networkSecurityClient.listAuthorizationPolicies(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesLocationname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesLocationname.java new file mode 100644 index 00000000..2495e8f3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesLocationname.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_locationname_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListAuthorizationPoliciesLocationname { + + public static void main(String[] args) throws Exception { + syncListAuthorizationPoliciesLocationname(); + } + + public static void syncListAuthorizationPoliciesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (AuthorizationPolicy element : + networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesString.java new file mode 100644 index 00000000..74a5b357 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listauthorizationpolicies/SyncListAuthorizationPoliciesString.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_string_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListAuthorizationPoliciesString { + + public static void main(String[] args) throws Exception { + syncListAuthorizationPoliciesString(); + } + + public static void syncListAuthorizationPoliciesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (AuthorizationPolicy element : + networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listauthorizationpolicies_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPolicies.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPolicies.java new file mode 100644 index 00000000..013db8b6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPolicies.java @@ -0,0 +1,51 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class AsyncListClientTlsPolicies { + + public static void main(String[] args) throws Exception { + asyncListClientTlsPolicies(); + } + + public static void asyncListClientTlsPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListClientTlsPoliciesRequest request = + ListClientTlsPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + networkSecurityClient.listClientTlsPoliciesPagedCallable().futureCall(request); + // Do something. + for (ClientTlsPolicy element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPoliciesPaged.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPoliciesPaged.java new file mode 100644 index 00000000..48065743 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/AsyncListClientTlsPoliciesPaged.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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_paged_async] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.ListClientTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.common.base.Strings; + +public class AsyncListClientTlsPoliciesPaged { + + public static void main(String[] args) throws Exception { + asyncListClientTlsPoliciesPaged(); + } + + public static void asyncListClientTlsPoliciesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListClientTlsPoliciesRequest request = + ListClientTlsPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListClientTlsPoliciesResponse response = + networkSecurityClient.listClientTlsPoliciesCallable().call(request); + for (ClientTlsPolicy element : response.getClientTlsPoliciesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPolicies.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPolicies.java new file mode 100644 index 00000000..8ddbb2ab --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPolicies.java @@ -0,0 +1,48 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListClientTlsPolicies { + + public static void main(String[] args) throws Exception { + syncListClientTlsPolicies(); + } + + public static void syncListClientTlsPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListClientTlsPoliciesRequest request = + ListClientTlsPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ClientTlsPolicy element : + networkSecurityClient.listClientTlsPolicies(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesLocationname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesLocationname.java new file mode 100644 index 00000000..76847084 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesLocationname.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_locationname_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListClientTlsPoliciesLocationname { + + public static void main(String[] args) throws Exception { + syncListClientTlsPoliciesLocationname(); + } + + public static void syncListClientTlsPoliciesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ClientTlsPolicy element : + networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesString.java new file mode 100644 index 00000000..91070966 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listclienttlspolicies/SyncListClientTlsPoliciesString.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_string_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListClientTlsPoliciesString { + + public static void main(String[] args) throws Exception { + syncListClientTlsPoliciesString(); + } + + public static void syncListClientTlsPoliciesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ClientTlsPolicy element : + networkSecurityClient.listClientTlsPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listclienttlspolicies_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPolicies.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPolicies.java new file mode 100644 index 00000000..2952222a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPolicies.java @@ -0,0 +1,51 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; + +public class AsyncListServerTlsPolicies { + + public static void main(String[] args) throws Exception { + asyncListServerTlsPolicies(); + } + + public static void asyncListServerTlsPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListServerTlsPoliciesRequest request = + ListServerTlsPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + networkSecurityClient.listServerTlsPoliciesPagedCallable().futureCall(request); + // Do something. + for (ServerTlsPolicy element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPoliciesPaged.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPoliciesPaged.java new file mode 100644 index 00000000..0d40acda --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/AsyncListServerTlsPoliciesPaged.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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_paged_async] +import com.google.cloud.networksecurity.v1beta1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.ListServerTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.common.base.Strings; + +public class AsyncListServerTlsPoliciesPaged { + + public static void main(String[] args) throws Exception { + asyncListServerTlsPoliciesPaged(); + } + + public static void asyncListServerTlsPoliciesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListServerTlsPoliciesRequest request = + ListServerTlsPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListServerTlsPoliciesResponse response = + networkSecurityClient.listServerTlsPoliciesCallable().call(request); + for (ServerTlsPolicy element : response.getServerTlsPoliciesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPolicies.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPolicies.java new file mode 100644 index 00000000..3909b300 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPolicies.java @@ -0,0 +1,48 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_sync] +import com.google.cloud.networksecurity.v1beta1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; + +public class SyncListServerTlsPolicies { + + public static void main(String[] args) throws Exception { + syncListServerTlsPolicies(); + } + + public static void syncListServerTlsPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListServerTlsPoliciesRequest request = + ListServerTlsPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ServerTlsPolicy element : + networkSecurityClient.listServerTlsPolicies(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesLocationname.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesLocationname.java new file mode 100644 index 00000000..efe82605 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesLocationname.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_locationname_sync] +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; + +public class SyncListServerTlsPoliciesLocationname { + + public static void main(String[] args) throws Exception { + syncListServerTlsPoliciesLocationname(); + } + + public static void syncListServerTlsPoliciesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ServerTlsPolicy element : + networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesString.java new file mode 100644 index 00000000..220f14cf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listservertlspolicies/SyncListServerTlsPoliciesString.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_string_sync] +import com.google.cloud.networksecurity.v1beta1.LocationName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; + +public class SyncListServerTlsPoliciesString { + + public static void main(String[] args) throws Exception { + syncListServerTlsPoliciesString(); + } + + public static void syncListServerTlsPoliciesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ServerTlsPolicy element : + networkSecurityClient.listServerTlsPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listservertlspolicies_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicy.java new file mode 100644 index 00000000..7d2875d9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.UpdateAuthorizationPolicyRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + asyncUpdateAuthorizationPolicy(); + } + + public static void asyncUpdateAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateAuthorizationPolicyRequest request = + UpdateAuthorizationPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) + .build(); + ApiFuture future = + networkSecurityClient.updateAuthorizationPolicyCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicyLRO.java new file mode 100644 index 00000000..6a6b3f7b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/AsyncUpdateAuthorizationPolicyLRO.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.cloud.networksecurity.v1beta1.UpdateAuthorizationPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateAuthorizationPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateAuthorizationPolicyLRO(); + } + + public static void asyncUpdateAuthorizationPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateAuthorizationPolicyRequest request = + UpdateAuthorizationPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) + .build(); + OperationFuture future = + networkSecurityClient.updateAuthorizationPolicyOperationCallable().futureCall(request); + // Do something. + AuthorizationPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicy.java new file mode 100644 index 00000000..9b7f0137 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicy.java @@ -0,0 +1,45 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.UpdateAuthorizationPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + syncUpdateAuthorizationPolicy(); + } + + public static void syncUpdateAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateAuthorizationPolicyRequest request = + UpdateAuthorizationPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) + .build(); + AuthorizationPolicy response = + networkSecurityClient.updateAuthorizationPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask.java new file mode 100644 index 00000000..6e5bc1b5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateauthorizationpolicy/SyncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask.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. + */ + +package com.google.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_authorizationpolicyfieldmask_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask(); + } + + public static void syncUpdateAuthorizationPolicyAuthorizationpolicyFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + AuthorizationPolicy response = + networkSecurityClient + .updateAuthorizationPolicyAsync(authorizationPolicy, updateMask) + .get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateauthorizationpolicy_authorizationpolicyfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicy.java new file mode 100644 index 00000000..ee36efb5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.UpdateClientTlsPolicyRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateClientTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncUpdateClientTlsPolicy(); + } + + public static void asyncUpdateClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateClientTlsPolicyRequest request = + UpdateClientTlsPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) + .build(); + ApiFuture future = + networkSecurityClient.updateClientTlsPolicyCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicyLRO.java new file mode 100644 index 00000000..e12cf5c6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/AsyncUpdateClientTlsPolicyLRO.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.cloud.networksecurity.v1beta1.UpdateClientTlsPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateClientTlsPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateClientTlsPolicyLRO(); + } + + public static void asyncUpdateClientTlsPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateClientTlsPolicyRequest request = + UpdateClientTlsPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) + .build(); + OperationFuture future = + networkSecurityClient.updateClientTlsPolicyOperationCallable().futureCall(request); + // Do something. + ClientTlsPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicy.java new file mode 100644 index 00000000..e690b7cf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicy.java @@ -0,0 +1,44 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.UpdateClientTlsPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateClientTlsPolicy { + + public static void main(String[] args) throws Exception { + syncUpdateClientTlsPolicy(); + } + + public static void syncUpdateClientTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateClientTlsPolicyRequest request = + UpdateClientTlsPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) + .build(); + ClientTlsPolicy response = networkSecurityClient.updateClientTlsPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicyClienttlspolicyFieldmask.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicyClienttlspolicyFieldmask.java new file mode 100644 index 00000000..f8d0f0b9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateclienttlspolicy/SyncUpdateClientTlsPolicyClienttlspolicyFieldmask.java @@ -0,0 +1,41 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_clienttlspolicyfieldmask_sync] +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateClientTlsPolicyClienttlspolicyFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateClientTlsPolicyClienttlspolicyFieldmask(); + } + + public static void syncUpdateClientTlsPolicyClienttlspolicyFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + ClientTlsPolicy response = + networkSecurityClient.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateclienttlspolicy_clienttlspolicyfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicy.java new file mode 100644 index 00000000..462fc65a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicy.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateServerTlsPolicy { + + public static void main(String[] args) throws Exception { + asyncUpdateServerTlsPolicy(); + } + + public static void asyncUpdateServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateServerTlsPolicyRequest request = + UpdateServerTlsPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) + .build(); + ApiFuture future = + networkSecurityClient.updateServerTlsPolicyCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicyLRO.java new file mode 100644 index 00000000..f84eed6a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/AsyncUpdateServerTlsPolicyLRO.java @@ -0,0 +1,49 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateServerTlsPolicyLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateServerTlsPolicyLRO(); + } + + public static void asyncUpdateServerTlsPolicyLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateServerTlsPolicyRequest request = + UpdateServerTlsPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) + .build(); + OperationFuture future = + networkSecurityClient.updateServerTlsPolicyOperationCallable().futureCall(request); + // Do something. + ServerTlsPolicy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicy.java new file mode 100644 index 00000000..b1c1eea6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicy.java @@ -0,0 +1,44 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateServerTlsPolicy { + + public static void main(String[] args) throws Exception { + syncUpdateServerTlsPolicy(); + } + + public static void syncUpdateServerTlsPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + UpdateServerTlsPolicyRequest request = + UpdateServerTlsPolicyRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) + .build(); + ServerTlsPolicy response = networkSecurityClient.updateServerTlsPolicyAsync(request).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicyServertlspolicyFieldmask.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicyServertlspolicyFieldmask.java new file mode 100644 index 00000000..1b9c99fc --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/updateservertlspolicy/SyncUpdateServerTlsPolicyServertlspolicyFieldmask.java @@ -0,0 +1,41 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_servertlspolicyfieldmask_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.protobuf.FieldMask; + +public class SyncUpdateServerTlsPolicyServertlspolicyFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateServerTlsPolicyServertlspolicyFieldmask(); + } + + public static void syncUpdateServerTlsPolicyServertlspolicyFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + ServerTlsPolicy response = + networkSecurityClient.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_updateservertlspolicy_servertlspolicyfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecuritysettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecuritysettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java new file mode 100644 index 00000000..70d790a8 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecuritysettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java @@ -0,0 +1,46 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecuritysettings_getauthorizationpolicy_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecuritySettings; +import java.time.Duration; + +public class SyncGetAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + syncGetAuthorizationPolicy(); + } + + public static void syncGetAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + NetworkSecuritySettings.Builder networkSecuritySettingsBuilder = + NetworkSecuritySettings.newBuilder(); + networkSecuritySettingsBuilder + .getAuthorizationPolicySettings() + .setRetrySettings( + networkSecuritySettingsBuilder + .getAuthorizationPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + NetworkSecuritySettings networkSecuritySettings = networkSecuritySettingsBuilder.build(); + } +} +// [END networksecurity_v1beta1_generated_networksecuritysettings_getauthorizationpolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/stub/networksecuritystubsettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/stub/networksecuritystubsettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java new file mode 100644 index 00000000..587bda19 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/stub/networksecuritystubsettings/getauthorizationpolicy/SyncGetAuthorizationPolicy.java @@ -0,0 +1,46 @@ +/* + * 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.cloud.networksecurity.v1beta1.stub.samples; + +// [START networksecurity_v1beta1_generated_networksecuritystubsettings_getauthorizationpolicy_sync] +import com.google.cloud.networksecurity.v1beta1.stub.NetworkSecurityStubSettings; +import java.time.Duration; + +public class SyncGetAuthorizationPolicy { + + public static void main(String[] args) throws Exception { + syncGetAuthorizationPolicy(); + } + + public static void syncGetAuthorizationPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + NetworkSecurityStubSettings.Builder networkSecuritySettingsBuilder = + NetworkSecurityStubSettings.newBuilder(); + networkSecuritySettingsBuilder + .getAuthorizationPolicySettings() + .setRetrySettings( + networkSecuritySettingsBuilder + .getAuthorizationPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + NetworkSecurityStubSettings networkSecuritySettings = networkSecuritySettingsBuilder.build(); + } +} +// [END networksecurity_v1beta1_generated_networksecuritystubsettings_getauthorizationpolicy_sync] diff --git a/versions.txt b/versions.txt index 7ab40f88..7ec8539b 100644 --- a/versions.txt +++ b/versions.txt @@ -4,3 +4,5 @@ google-cloud-network-security:0.5.1:0.5.2-SNAPSHOT grpc-google-cloud-network-security-v1beta1:0.5.1:0.5.2-SNAPSHOT proto-google-cloud-network-security-v1beta1:0.5.1:0.5.2-SNAPSHOT +proto-google-cloud-network-security-v1:0.5.1:0.5.2-SNAPSHOT +grpc-google-cloud-network-security-v1:0.5.1:0.5.2-SNAPSHOT From d8d4b16d24511097c08079ac1a8b1985b25a72cd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Jul 2022 19:30:27 +0200 Subject: [PATCH 09/14] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3 (#185) 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-deploy-plugin](https://maven.apache.org/plugins/) | `2.8.2` -> `3.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/compatibility-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/confidence-slim/2.8.2)](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-network-security). --- samples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/pom.xml b/samples/pom.xml index 2af63c6f..264d9dbb 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -38,7 +38,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.0.0 true From 459c6b3f0993a263c73023c0dc38851da62e9fab Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 3 Aug 2022 01:02:21 +0200 Subject: [PATCH 10/14] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.3 (#188) 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.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.1)](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.1)](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)) ### [`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-network-security). --- google-cloud-network-security-bom/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-network-security-bom/pom.xml b/google-cloud-network-security-bom/pom.xml index 1ee47568..320d5446 100644 --- a/google-cloud-network-security-bom/pom.xml +++ b/google-cloud-network-security-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud google-cloud-shared-config - 1.5.1 + 1.5.3 Google Network Security API BOM diff --git a/pom.xml b/pom.xml index a2ef4fe5..37b1ee8f 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.1 + 1.5.3 From 36d3cdca32a4103e610f91a89955b9ce98e5f953 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 3 Aug 2022 01:08:14 +0200 Subject: [PATCH 11/14] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3 (#187) 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.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/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.1/confidence-slim/2.13.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)) ### [`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-network-security). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 37b1ee8f..1f1451f2 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,7 @@ com.google.cloud google-cloud-shared-dependencies - 2.13.0 + 3.0.1 pom import From 221f44bdcae9e0865959fb6f6d3931a8fa4cf6b8 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Mon, 8 Aug 2022 16:28:17 -0400 Subject: [PATCH 12/14] ci: clirr is not required (#189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-network-security/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ If you write sample code, please follow the [samples format]( https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- .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 0181fcd5..0501f63f 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' @@ -28,7 +27,6 @@ branchProtectionRules: - dependencies (8) - dependencies (11) - lint - - clirr - units (7) - units (8) - units (11) From 0b8e3c9bd8628c6acf251bc70c3eeb6fcede88f2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 16:35:19 -0400 Subject: [PATCH 13/14] docs: update the comments of various networksecurity resources (#186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update the comments of various networksecurity resources fix!: fix annotation of parent in Create*Request PiperOrigin-RevId: 462271672 Source-Link: https://github.com/googleapis/googleapis/commit/9213efa96e4fc4d3a37899e4a2cde06598607941 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb69561e8c95031d2f799285ed21bc65608eee96 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI2OTU2MWU4Yzk1MDMxZDJmNzk5Mjg1ZWQyMWJjNjU2MDhlZWU5NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update pom.xml * deps: adding grpc-google-iam-v1 * deps: added grpc-google-common-protos Co-authored-by: Owl Bot Co-authored-by: Blake Li Co-authored-by: Tomo Suzuki --- google-cloud-network-security/pom.xml | 28 + .../v1beta1/NetworkSecurityClient.java | 511 ++++- .../v1beta1/NetworkSecuritySettings.java | 88 +- .../v1beta1/gapic_metadata.json | 15 + .../networksecurity/v1beta1/package-info.java | 4 +- .../v1beta1/stub/GrpcNetworkSecurityStub.java | 167 ++ ...ttpJsonNetworkSecurityCallableFactory.java | 105 + .../stub/HttpJsonNetworkSecurityStub.java | 1518 +++++++++++++ .../v1beta1/stub/NetworkSecurityStub.java | 42 +- .../stub/NetworkSecurityStubSettings.java | 241 ++- .../v1beta1/MockIAMPolicy.java | 59 + .../v1beta1/MockIAMPolicyImpl.java | 127 ++ .../v1beta1/MockLocations.java | 59 + .../v1beta1/MockLocationsImpl.java | 105 + .../NetworkSecurityClientHttpJsonTest.java | 1920 +++++++++++++++++ .../v1beta1/NetworkSecurityClientTest.java | 300 ++- .../v1beta1/AuthorizationPolicy.java | 1301 +++++------ .../v1beta1/AuthorizationPolicyOrBuilder.java | 60 +- .../v1beta1/AuthorizationPolicyProto.java | 126 +- .../v1beta1/CertificateProviderInstance.java | 42 +- .../CertificateProviderInstanceOrBuilder.java | 12 +- .../v1beta1/ClientTlsPolicy.java | 198 +- .../v1beta1/ClientTlsPolicyOrBuilder.java | 45 +- .../v1beta1/ClientTlsPolicyProto.java | 95 +- .../networksecurity/v1beta1/CommonProto.java | 32 +- .../v1beta1/CreateClientTlsPolicyRequest.java | 49 +- ...CreateClientTlsPolicyRequestOrBuilder.java | 14 +- .../v1beta1/CreateServerTlsPolicyRequest.java | 49 +- ...CreateServerTlsPolicyRequestOrBuilder.java | 14 +- .../DeleteAuthorizationPolicyRequest.java | 28 +- ...teAuthorizationPolicyRequestOrBuilder.java | 8 +- .../networksecurity/v1beta1/GrpcEndpoint.java | 28 +- .../v1beta1/GrpcEndpointOrBuilder.java | 8 +- .../v1beta1/OperationMetadata.java | 20 +- .../v1beta1/OperationMetadataOrBuilder.java | 5 +- .../v1beta1/ServerTlsPolicy.java | 8 + .../v1beta1/ServerTlsPolicyOrBuilder.java | 2 + .../v1beta1/ServerTlsPolicyProto.java | 99 +- .../networksecurity/v1beta1/TlsProto.java | 45 +- .../v1beta1/authorization_policy.proto | 97 +- .../v1beta1/client_tls_policy.proto | 44 +- .../networksecurity/v1beta1/common.proto | 12 +- .../v1beta1/server_tls_policy.proto | 29 +- .../cloud/networksecurity/v1beta1/tls.proto | 11 +- .../SyncCreateSetCredentialsProvider1.java | 41 + .../AsyncCreateAuthorizationPolicy.java | 6 +- .../AsyncCreateAuthorizationPolicyLRO.java | 6 +- .../SyncCreateAuthorizationPolicy.java | 6 +- ...ocationnameAuthorizationpolicyString.java} | 15 +- ...PolicyStringAuthorizationpolicyString.java | 6 +- .../AsyncCreateClientTlsPolicy.java | 6 +- .../AsyncCreateClientTlsPolicyLRO.java | 6 +- .../SyncCreateClientTlsPolicy.java | 6 +- ...icyLocationnameClienttlspolicyString.java} | 16 +- ...tTlsPolicyStringClienttlspolicyString.java | 5 +- .../AsyncCreateServerTlsPolicy.java | 6 +- .../AsyncCreateServerTlsPolicyLRO.java | 6 +- .../SyncCreateServerTlsPolicy.java | 6 +- ...icyLocationnameServertlspolicyString.java} | 16 +- ...rTlsPolicyStringServertlspolicyString.java | 5 +- .../getiampolicy/AsyncGetIamPolicy.java | 50 + .../getiampolicy/SyncGetIamPolicy.java | 47 + .../getlocation/AsyncGetLocation.java | 42 + .../getlocation/SyncGetLocation.java | 39 + .../listlocations/AsyncListLocations.java | 51 + .../AsyncListLocationsPaged.java | 59 + .../listlocations/SyncListLocations.java | 47 + .../setiampolicy/AsyncSetIamPolicy.java | 51 + .../setiampolicy/SyncSetIamPolicy.java | 48 + .../AsyncTestIamPermissions.java | 51 + .../SyncTestIamPermissions.java | 47 + 71 files changed, 7136 insertions(+), 1324 deletions(-) create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityCallableFactory.java create mode 100644 google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityStub.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicy.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicyImpl.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocations.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocationsImpl.java create mode 100644 google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientHttpJsonTest.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider1.java rename samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/{SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java => SyncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString.java} (71%) rename samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/{SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java => SyncCreateClientTlsPolicyLocationnameClienttlspolicyString.java} (72%) rename samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/{SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java => SyncCreateServerTlsPolicyLocationnameServertlspolicyString.java} (72%) create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/AsyncGetLocation.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/SyncGetLocation.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocations.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocationsPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/SyncListLocations.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/SyncTestIamPermissions.java diff --git a/google-cloud-network-security/pom.xml b/google-cloud-network-security/pom.xml index cc6852d4..8ca6b5cb 100644 --- a/google-cloud-network-security/pom.xml +++ b/google-cloud-network-security/pom.xml @@ -37,10 +37,22 @@ com.google.protobuf protobuf-java
+ + com.google.api.grpc + grpc-google-common-protos + com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + com.google.api.grpc @@ -62,6 +74,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -86,12 +102,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-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClient.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClient.java index 07ac0804..cf60672e 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClient.java +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClient.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; @@ -27,11 +28,19 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.networksecurity.v1beta1.stub.NetworkSecurityStub; import com.google.cloud.networksecurity.v1beta1.stub.NetworkSecurityStubSettings; import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -108,6 +117,21 @@ * NetworkSecurityClient.create(networkSecuritySettings); * } * + *

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.
+ * NetworkSecuritySettings networkSecuritySettings =
+ *     NetworkSecuritySettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             NetworkSecuritySettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * NetworkSecurityClient networkSecurityClient =
+ *     NetworkSecurityClient.create(networkSecuritySettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -115,7 +139,8 @@ public class NetworkSecurityClient implements BackgroundResource { private final NetworkSecuritySettings settings; private final NetworkSecurityStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of NetworkSecurityClient with default settings. */ public static final NetworkSecurityClient create() throws IOException { @@ -147,13 +172,17 @@ public static final NetworkSecurityClient create(NetworkSecurityStub stub) { protected NetworkSecurityClient(NetworkSecuritySettings settings) throws IOException { this.settings = settings; this.stub = ((NetworkSecurityStubSettings) 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 NetworkSecurityClient(NetworkSecurityStub 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 NetworkSecuritySettings getSettings() { @@ -168,10 +197,19 @@ public NetworkSecurityStub 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. /** * Lists AuthorizationPolicies in a given project and location. @@ -450,8 +488,7 @@ public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRe * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - * AuthorizationPolicyName parent = - * AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); * String authorizationPolicyId = "authorizationPolicyId1314252166"; * AuthorizationPolicy response = @@ -471,7 +508,7 @@ public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRe */ public final OperationFuture createAuthorizationPolicyAsync( - AuthorizationPolicyName parent, + LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId) { CreateAuthorizationPolicyRequest request = @@ -493,9 +530,7 @@ public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRe * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - * String parent = - * AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - * .toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); * String authorizationPolicyId = "authorizationPolicyId1314252166"; * AuthorizationPolicy response = @@ -537,9 +572,7 @@ public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRe * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateAuthorizationPolicyRequest request = * CreateAuthorizationPolicyRequest.newBuilder() - * .setParent( - * AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setAuthorizationPolicyId("authorizationPolicyId1314252166") * .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) * .build(); @@ -568,9 +601,7 @@ public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRe * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateAuthorizationPolicyRequest request = * CreateAuthorizationPolicyRequest.newBuilder() - * .setParent( - * AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setAuthorizationPolicyId("authorizationPolicyId1314252166") * .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) * .build(); @@ -599,9 +630,7 @@ public final AuthorizationPolicy getAuthorizationPolicy(GetAuthorizationPolicyRe * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateAuthorizationPolicyRequest request = * CreateAuthorizationPolicyRequest.newBuilder() - * .setParent( - * AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setAuthorizationPolicyId("authorizationPolicyId1314252166") * .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) * .build(); @@ -1153,8 +1182,7 @@ public final ServerTlsPolicy getServerTlsPolicy(GetServerTlsPolicyRequest reques * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - * ServerTlsPolicyName parent = - * ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); * String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; * ServerTlsPolicy response = @@ -1173,7 +1201,7 @@ public final ServerTlsPolicy getServerTlsPolicy(GetServerTlsPolicyRequest reques * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createServerTlsPolicyAsync( - ServerTlsPolicyName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) { + LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) @@ -1193,8 +1221,7 @@ public final OperationFuture createServerTls * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - * String parent = - * ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); * String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; * ServerTlsPolicy response = @@ -1235,9 +1262,7 @@ public final OperationFuture createServerTls * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateServerTlsPolicyRequest request = * CreateServerTlsPolicyRequest.newBuilder() - * .setParent( - * ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setServerTlsPolicyId("serverTlsPolicyId-1966046011") * .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) * .build(); @@ -1265,9 +1290,7 @@ public final OperationFuture createServerTls * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateServerTlsPolicyRequest request = * CreateServerTlsPolicyRequest.newBuilder() - * .setParent( - * ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setServerTlsPolicyId("serverTlsPolicyId-1966046011") * .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) * .build(); @@ -1295,9 +1318,7 @@ public final OperationFuture createServerTls * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateServerTlsPolicyRequest request = * CreateServerTlsPolicyRequest.newBuilder() - * .setParent( - * ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setServerTlsPolicyId("serverTlsPolicyId-1966046011") * .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) * .build(); @@ -1842,8 +1863,7 @@ public final ClientTlsPolicy getClientTlsPolicy(GetClientTlsPolicyRequest reques * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - * ClientTlsPolicyName parent = - * ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); * String clientTlsPolicyId = "clientTlsPolicyId-188933315"; * ClientTlsPolicy response = @@ -1862,7 +1882,7 @@ public final ClientTlsPolicy getClientTlsPolicy(GetClientTlsPolicyRequest reques * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createClientTlsPolicyAsync( - ClientTlsPolicyName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) { + LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) @@ -1882,8 +1902,7 @@ public final OperationFuture createClientTls * // This snippet has been automatically generated for illustrative purposes only. * // It may require modifications to work in your environment. * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - * String parent = - * ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); * String clientTlsPolicyId = "clientTlsPolicyId-188933315"; * ClientTlsPolicy response = @@ -1924,9 +1943,7 @@ public final OperationFuture createClientTls * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateClientTlsPolicyRequest request = * CreateClientTlsPolicyRequest.newBuilder() - * .setParent( - * ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setClientTlsPolicyId("clientTlsPolicyId-188933315") * .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) * .build(); @@ -1954,9 +1971,7 @@ public final OperationFuture createClientTls * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateClientTlsPolicyRequest request = * CreateClientTlsPolicyRequest.newBuilder() - * .setParent( - * ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setClientTlsPolicyId("clientTlsPolicyId-188933315") * .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) * .build(); @@ -1984,9 +1999,7 @@ public final OperationFuture createClientTls * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { * CreateClientTlsPolicyRequest request = * CreateClientTlsPolicyRequest.newBuilder() - * .setParent( - * ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setClientTlsPolicyId("clientTlsPolicyId-188933315") * .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) * .build(); @@ -2256,6 +2269,332 @@ public final OperationFuture deleteClientTlsPolicyAsyn return stub.deleteClientTlsPolicyCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : networkSecurityClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         networkSecurityClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = networkSecurityClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = networkSecurityClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = networkSecurityClient.setIamPolicy(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 setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = networkSecurityClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = networkSecurityClient.getIamPolicy(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 getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = networkSecurityClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = networkSecurityClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       networkSecurityClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + @Override public final void close() { stub.close(); @@ -2549,4 +2888,80 @@ protected ListClientTlsPoliciesFixedSizeCollection createCollection( return new ListClientTlsPoliciesFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecuritySettings.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecuritySettings.java index 795e1e78..9d121096 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecuritySettings.java +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/NetworkSecuritySettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; import com.google.api.core.ApiFunction; @@ -25,6 +26,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; @@ -32,7 +34,16 @@ import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.networksecurity.v1beta1.stub.NetworkSecurityStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -242,6 +253,33 @@ public class NetworkSecuritySettings extends ClientSettings + listLocationsSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((NetworkSecurityStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + public static final NetworkSecuritySettings create(NetworkSecurityStubSettings stub) throws IOException { return new NetworkSecuritySettings.Builder(stub.toBuilder()).build(); @@ -267,11 +305,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return NetworkSecurityStubSettings.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 NetworkSecurityStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return NetworkSecurityStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return NetworkSecurityStubSettings.defaultTransportChannelProvider(); } @@ -281,11 +326,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return NetworkSecurityStubSettings.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); @@ -323,6 +374,11 @@ private static Builder createDefault() { return new Builder(NetworkSecurityStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(NetworkSecurityStubSettings.newHttpJsonBuilder()); + } + public NetworkSecurityStubSettings.Builder getStubSettingsBuilder() { return ((NetworkSecurityStubSettings.Builder) getStubSettings()); } @@ -498,6 +554,34 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().deleteClientTlsPolicyOperationSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + @Override public NetworkSecuritySettings build() throws IOException { return new NetworkSecuritySettings(this); diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/gapic_metadata.json b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/gapic_metadata.json index b7b8623f..ab16ffdf 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/gapic_metadata.json +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/gapic_metadata.json @@ -34,6 +34,12 @@ "GetClientTlsPolicy": { "methods": ["getClientTlsPolicy", "getClientTlsPolicy", "getClientTlsPolicy", "getClientTlsPolicyCallable"] }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetServerTlsPolicy": { "methods": ["getServerTlsPolicy", "getServerTlsPolicy", "getServerTlsPolicy", "getServerTlsPolicyCallable"] }, @@ -43,9 +49,18 @@ "ListClientTlsPolicies": { "methods": ["listClientTlsPolicies", "listClientTlsPolicies", "listClientTlsPolicies", "listClientTlsPoliciesPagedCallable", "listClientTlsPoliciesCallable"] }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, "ListServerTlsPolicies": { "methods": ["listServerTlsPolicies", "listServerTlsPolicies", "listServerTlsPolicies", "listServerTlsPoliciesPagedCallable", "listServerTlsPoliciesCallable"] }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, "UpdateAuthorizationPolicy": { "methods": ["updateAuthorizationPolicyAsync", "updateAuthorizationPolicyAsync", "updateAuthorizationPolicyOperationCallable", "updateAuthorizationPolicyCallable"] }, diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/package-info.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/package-info.java index 5935a4ae..d31f1e36 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/package-info.java +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Network Security API + * + *

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

======================= NetworkSecurityClient ======================= * diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/GrpcNetworkSecurityStub.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/GrpcNetworkSecurityStub.java index cc67eb55..5f7fb26b 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/GrpcNetworkSecurityStub.java +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/GrpcNetworkSecurityStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; import com.google.api.core.BetaApi; @@ -28,6 +29,10 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; @@ -51,6 +56,11 @@ import com.google.cloud.networksecurity.v1beta1.UpdateClientTlsPolicyRequest; import com.google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest; import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -240,6 +250,52 @@ public class GrpcNetworkSecurityStub extends NetworkSecurityStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listAuthorizationPoliciesCallable; private final UnaryCallable< @@ -297,6 +353,14 @@ public class GrpcNetworkSecurityStub extends NetworkSecurityStub { deleteClientTlsPolicyCallable; private final OperationCallable deleteClientTlsPolicyOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -516,6 +580,57 @@ protected GrpcNetworkSecurityStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.listAuthorizationPoliciesCallable = callableFactory.createUnaryCallable( @@ -661,6 +776,26 @@ protected GrpcNetworkSecurityStub( settings.deleteClientTlsPolicyOperationSettings(), clientContext, operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -824,6 +959,38 @@ public UnaryCallable deleteClientTlsPol return deleteClientTlsPolicyOperationCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityCallableFactory.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityCallableFactory.java new file mode 100644 index 00000000..d1b697c6 --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityCallableFactory.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.cloud.networksecurity.v1beta1.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 NetworkSecurity service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonNetworkSecurityCallableFactory + 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-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityStub.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityStub.java new file mode 100644 index 00000000..8a129fbd --- /dev/null +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/HttpJsonNetworkSecurityStub.java @@ -0,0 +1,1518 @@ +/* + * 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.cloud.networksecurity.v1beta1.stub; + +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; +import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.DeleteAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.DeleteClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.DeleteServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.GetAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.GetClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.GetServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.ListAuthorizationPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.ListAuthorizationPoliciesResponse; +import com.google.cloud.networksecurity.v1beta1.ListClientTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.ListClientTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1beta1.ListServerTlsPoliciesRequest; +import com.google.cloud.networksecurity.v1beta1.ListServerTlsPoliciesResponse; +import com.google.cloud.networksecurity.v1beta1.OperationMetadata; +import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; +import com.google.cloud.networksecurity.v1beta1.UpdateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.UpdateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 NetworkSecurity service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonNetworkSecurityStub extends NetworkSecurityStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(ServerTlsPolicy.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(AuthorizationPolicy.getDescriptor()) + .add(ClientTlsPolicy.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor< + ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesResponse> + listAuthorizationPoliciesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/ListAuthorizationPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/authorizationPolicies", + 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(ListAuthorizationPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getAuthorizationPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/GetAuthorizationPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/authorizationPolicies/*}", + 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(AuthorizationPolicy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createAuthorizationPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/CreateAuthorizationPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/authorizationPolicies", + 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, + "authorizationPolicyId", + request.getAuthorizationPolicyId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("authorizationPolicy", request.getAuthorizationPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateAuthorizationPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateAuthorizationPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/UpdateAuthorizationPolicy") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{authorizationPolicy.name=projects/*/locations/*/authorizationPolicies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "authorizationPolicy.name", + request.getAuthorizationPolicy().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("authorizationPolicy", request.getAuthorizationPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateAuthorizationPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteAuthorizationPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/DeleteAuthorizationPolicy") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/authorizationPolicies/*}", + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteAuthorizationPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListServerTlsPoliciesRequest, ListServerTlsPoliciesResponse> + listServerTlsPoliciesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/ListServerTlsPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/serverTlsPolicies", + 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(ListServerTlsPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getServerTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/GetServerTlsPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/serverTlsPolicies/*}", + 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(ServerTlsPolicy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createServerTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/CreateServerTlsPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/serverTlsPolicies", + 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, "serverTlsPolicyId", request.getServerTlsPolicyId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("serverTlsPolicy", request.getServerTlsPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateServerTlsPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateServerTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/UpdateServerTlsPolicy") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{serverTlsPolicy.name=projects/*/locations/*/serverTlsPolicies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "serverTlsPolicy.name", + request.getServerTlsPolicy().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("serverTlsPolicy", request.getServerTlsPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateServerTlsPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteServerTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/DeleteServerTlsPolicy") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/serverTlsPolicies/*}", + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteServerTlsPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListClientTlsPoliciesRequest, ListClientTlsPoliciesResponse> + listClientTlsPoliciesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/ListClientTlsPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/clientTlsPolicies", + 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(ListClientTlsPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getClientTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/GetClientTlsPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/clientTlsPolicies/*}", + 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(ClientTlsPolicy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createClientTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/CreateClientTlsPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/clientTlsPolicies", + 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, "clientTlsPolicyId", request.getClientTlsPolicyId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("clientTlsPolicy", request.getClientTlsPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateClientTlsPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateClientTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/UpdateClientTlsPolicy") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{clientTlsPolicy.name=projects/*/locations/*/clientTlsPolicies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "clientTlsPolicy.name", + request.getClientTlsPolicy().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("clientTlsPolicy", request.getClientTlsPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateClientTlsPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteClientTlsPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.networksecurity.v1beta1.NetworkSecurity/DeleteClientTlsPolicy") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/clientTlsPolicies/*}", + 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(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteClientTlsPolicyRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + 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(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + 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(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy") + .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 + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listAuthorizationPoliciesCallable; + private final UnaryCallable< + ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesPagedResponse> + listAuthorizationPoliciesPagedCallable; + private final UnaryCallable + getAuthorizationPolicyCallable; + private final UnaryCallable + createAuthorizationPolicyCallable; + private final OperationCallable< + CreateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + createAuthorizationPolicyOperationCallable; + private final UnaryCallable + updateAuthorizationPolicyCallable; + private final OperationCallable< + UpdateAuthorizationPolicyRequest, AuthorizationPolicy, OperationMetadata> + updateAuthorizationPolicyOperationCallable; + private final UnaryCallable + deleteAuthorizationPolicyCallable; + private final OperationCallable + deleteAuthorizationPolicyOperationCallable; + private final UnaryCallable + listServerTlsPoliciesCallable; + private final UnaryCallable + listServerTlsPoliciesPagedCallable; + private final UnaryCallable + getServerTlsPolicyCallable; + private final UnaryCallable + createServerTlsPolicyCallable; + private final OperationCallable + createServerTlsPolicyOperationCallable; + private final UnaryCallable + updateServerTlsPolicyCallable; + private final OperationCallable + updateServerTlsPolicyOperationCallable; + private final UnaryCallable + deleteServerTlsPolicyCallable; + private final OperationCallable + deleteServerTlsPolicyOperationCallable; + private final UnaryCallable + listClientTlsPoliciesCallable; + private final UnaryCallable + listClientTlsPoliciesPagedCallable; + private final UnaryCallable + getClientTlsPolicyCallable; + private final UnaryCallable + createClientTlsPolicyCallable; + private final OperationCallable + createClientTlsPolicyOperationCallable; + private final UnaryCallable + updateClientTlsPolicyCallable; + private final OperationCallable + updateClientTlsPolicyOperationCallable; + private final UnaryCallable + deleteClientTlsPolicyCallable; + private final OperationCallable + deleteClientTlsPolicyOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonNetworkSecurityStub create(NetworkSecurityStubSettings settings) + throws IOException { + return new HttpJsonNetworkSecurityStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonNetworkSecurityStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonNetworkSecurityStub( + NetworkSecurityStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonNetworkSecurityStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNetworkSecurityStub( + NetworkSecurityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonNetworkSecurityStub, 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 HttpJsonNetworkSecurityStub( + NetworkSecurityStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonNetworkSecurityCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonNetworkSecurityStub, 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 HttpJsonNetworkSecurityStub( + NetworkSecurityStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings + listAuthorizationPoliciesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listAuthorizationPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getAuthorizationPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAuthorizationPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createAuthorizationPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createAuthorizationPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateAuthorizationPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAuthorizationPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteAuthorizationPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAuthorizationPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listServerTlsPoliciesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listServerTlsPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getServerTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getServerTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createServerTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createServerTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateServerTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateServerTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteServerTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteServerTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listClientTlsPoliciesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listClientTlsPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getClientTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClientTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createClientTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClientTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateClientTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClientTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteClientTlsPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClientTlsPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listAuthorizationPoliciesCallable = + callableFactory.createUnaryCallable( + listAuthorizationPoliciesTransportSettings, + settings.listAuthorizationPoliciesSettings(), + clientContext); + this.listAuthorizationPoliciesPagedCallable = + callableFactory.createPagedCallable( + listAuthorizationPoliciesTransportSettings, + settings.listAuthorizationPoliciesSettings(), + clientContext); + this.getAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + getAuthorizationPolicyTransportSettings, + settings.getAuthorizationPolicySettings(), + clientContext); + this.createAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + createAuthorizationPolicyTransportSettings, + settings.createAuthorizationPolicySettings(), + clientContext); + this.createAuthorizationPolicyOperationCallable = + callableFactory.createOperationCallable( + createAuthorizationPolicyTransportSettings, + settings.createAuthorizationPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + updateAuthorizationPolicyTransportSettings, + settings.updateAuthorizationPolicySettings(), + clientContext); + this.updateAuthorizationPolicyOperationCallable = + callableFactory.createOperationCallable( + updateAuthorizationPolicyTransportSettings, + settings.updateAuthorizationPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteAuthorizationPolicyCallable = + callableFactory.createUnaryCallable( + deleteAuthorizationPolicyTransportSettings, + settings.deleteAuthorizationPolicySettings(), + clientContext); + this.deleteAuthorizationPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteAuthorizationPolicyTransportSettings, + settings.deleteAuthorizationPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listServerTlsPoliciesCallable = + callableFactory.createUnaryCallable( + listServerTlsPoliciesTransportSettings, + settings.listServerTlsPoliciesSettings(), + clientContext); + this.listServerTlsPoliciesPagedCallable = + callableFactory.createPagedCallable( + listServerTlsPoliciesTransportSettings, + settings.listServerTlsPoliciesSettings(), + clientContext); + this.getServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + getServerTlsPolicyTransportSettings, + settings.getServerTlsPolicySettings(), + clientContext); + this.createServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + createServerTlsPolicyTransportSettings, + settings.createServerTlsPolicySettings(), + clientContext); + this.createServerTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + createServerTlsPolicyTransportSettings, + settings.createServerTlsPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + updateServerTlsPolicyTransportSettings, + settings.updateServerTlsPolicySettings(), + clientContext); + this.updateServerTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + updateServerTlsPolicyTransportSettings, + settings.updateServerTlsPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteServerTlsPolicyCallable = + callableFactory.createUnaryCallable( + deleteServerTlsPolicyTransportSettings, + settings.deleteServerTlsPolicySettings(), + clientContext); + this.deleteServerTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteServerTlsPolicyTransportSettings, + settings.deleteServerTlsPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listClientTlsPoliciesCallable = + callableFactory.createUnaryCallable( + listClientTlsPoliciesTransportSettings, + settings.listClientTlsPoliciesSettings(), + clientContext); + this.listClientTlsPoliciesPagedCallable = + callableFactory.createPagedCallable( + listClientTlsPoliciesTransportSettings, + settings.listClientTlsPoliciesSettings(), + clientContext); + this.getClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + getClientTlsPolicyTransportSettings, + settings.getClientTlsPolicySettings(), + clientContext); + this.createClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + createClientTlsPolicyTransportSettings, + settings.createClientTlsPolicySettings(), + clientContext); + this.createClientTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + createClientTlsPolicyTransportSettings, + settings.createClientTlsPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + updateClientTlsPolicyTransportSettings, + settings.updateClientTlsPolicySettings(), + clientContext); + this.updateClientTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + updateClientTlsPolicyTransportSettings, + settings.updateClientTlsPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteClientTlsPolicyCallable = + callableFactory.createUnaryCallable( + deleteClientTlsPolicyTransportSettings, + settings.deleteClientTlsPolicySettings(), + clientContext); + this.deleteClientTlsPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteClientTlsPolicyTransportSettings, + settings.deleteClientTlsPolicyOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listAuthorizationPoliciesMethodDescriptor); + methodDescriptors.add(getAuthorizationPolicyMethodDescriptor); + methodDescriptors.add(createAuthorizationPolicyMethodDescriptor); + methodDescriptors.add(updateAuthorizationPolicyMethodDescriptor); + methodDescriptors.add(deleteAuthorizationPolicyMethodDescriptor); + methodDescriptors.add(listServerTlsPoliciesMethodDescriptor); + methodDescriptors.add(getServerTlsPolicyMethodDescriptor); + methodDescriptors.add(createServerTlsPolicyMethodDescriptor); + methodDescriptors.add(updateServerTlsPolicyMethodDescriptor); + methodDescriptors.add(deleteServerTlsPolicyMethodDescriptor); + methodDescriptors.add(listClientTlsPoliciesMethodDescriptor); + methodDescriptors.add(getClientTlsPolicyMethodDescriptor); + methodDescriptors.add(createClientTlsPolicyMethodDescriptor); + methodDescriptors.add(updateClientTlsPolicyMethodDescriptor); + methodDescriptors.add(deleteClientTlsPolicyMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable + listAuthorizationPoliciesCallable() { + return listAuthorizationPoliciesCallable; + } + + @Override + public UnaryCallable + listAuthorizationPoliciesPagedCallable() { + return listAuthorizationPoliciesPagedCallable; + } + + @Override + public UnaryCallable + getAuthorizationPolicyCallable() { + return getAuthorizationPolicyCallable; + } + + @Override + public UnaryCallable + createAuthorizationPolicyCallable() { + return createAuthorizationPolicyCallable; + } + + @Override + public OperationCallable + createAuthorizationPolicyOperationCallable() { + return createAuthorizationPolicyOperationCallable; + } + + @Override + public UnaryCallable + updateAuthorizationPolicyCallable() { + return updateAuthorizationPolicyCallable; + } + + @Override + public OperationCallable + updateAuthorizationPolicyOperationCallable() { + return updateAuthorizationPolicyOperationCallable; + } + + @Override + public UnaryCallable + deleteAuthorizationPolicyCallable() { + return deleteAuthorizationPolicyCallable; + } + + @Override + public OperationCallable + deleteAuthorizationPolicyOperationCallable() { + return deleteAuthorizationPolicyOperationCallable; + } + + @Override + public UnaryCallable + listServerTlsPoliciesCallable() { + return listServerTlsPoliciesCallable; + } + + @Override + public UnaryCallable + listServerTlsPoliciesPagedCallable() { + return listServerTlsPoliciesPagedCallable; + } + + @Override + public UnaryCallable getServerTlsPolicyCallable() { + return getServerTlsPolicyCallable; + } + + @Override + public UnaryCallable createServerTlsPolicyCallable() { + return createServerTlsPolicyCallable; + } + + @Override + public OperationCallable + createServerTlsPolicyOperationCallable() { + return createServerTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable updateServerTlsPolicyCallable() { + return updateServerTlsPolicyCallable; + } + + @Override + public OperationCallable + updateServerTlsPolicyOperationCallable() { + return updateServerTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable deleteServerTlsPolicyCallable() { + return deleteServerTlsPolicyCallable; + } + + @Override + public OperationCallable + deleteServerTlsPolicyOperationCallable() { + return deleteServerTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable + listClientTlsPoliciesCallable() { + return listClientTlsPoliciesCallable; + } + + @Override + public UnaryCallable + listClientTlsPoliciesPagedCallable() { + return listClientTlsPoliciesPagedCallable; + } + + @Override + public UnaryCallable getClientTlsPolicyCallable() { + return getClientTlsPolicyCallable; + } + + @Override + public UnaryCallable createClientTlsPolicyCallable() { + return createClientTlsPolicyCallable; + } + + @Override + public OperationCallable + createClientTlsPolicyOperationCallable() { + return createClientTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable updateClientTlsPolicyCallable() { + return updateClientTlsPolicyCallable; + } + + @Override + public OperationCallable + updateClientTlsPolicyOperationCallable() { + return updateClientTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable deleteClientTlsPolicyCallable() { + return deleteClientTlsPolicyCallable; + } + + @Override + public OperationCallable + deleteClientTlsPolicyOperationCallable() { + return deleteClientTlsPolicyOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStub.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStub.java index ae36993a..bd5b8925 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStub.java +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStub.java @@ -18,12 +18,17 @@ import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; @@ -46,6 +51,11 @@ import com.google.cloud.networksecurity.v1beta1.UpdateAuthorizationPolicyRequest; import com.google.cloud.networksecurity.v1beta1.UpdateClientTlsPolicyRequest; import com.google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -62,7 +72,11 @@ public abstract class NetworkSecurityStub 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 @@ -204,6 +218,32 @@ public UnaryCallable deleteClientTlsPol throw new UnsupportedOperationException("Not implemented: deleteClientTlsPolicyCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStubSettings.java b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStubSettings.java index dba484ff..1541921e 100644 --- a/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStubSettings.java +++ b/google-cloud-network-security/src/main/java/com/google/cloud/networksecurity/v1beta1/stub/NetworkSecurityStubSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; import com.google.api.core.ApiFunction; @@ -30,6 +31,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; @@ -46,6 +50,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; @@ -72,6 +80,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -184,6 +197,14 @@ public class NetworkSecurityStubSettings extends StubSettings deleteClientTlsPolicyOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private static final PagedListDescriptor< ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesResponse, AuthorizationPolicy> @@ -314,6 +335,42 @@ public Iterable extractResources( } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListAuthorizationPoliciesRequest, ListAuthorizationPoliciesResponse, @@ -390,6 +447,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listAuthorizationPolicies. */ public PagedCallSettings< ListAuthorizationPoliciesRequest, @@ -545,12 +619,44 @@ public ApiFuture getFuturePagedResponse( return deleteClientTlsPolicyOperationSettings; } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + public NetworkSecurityStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcNetworkSecurityStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonNetworkSecurityStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -583,18 +689,25 @@ 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(NetworkSecurityStubSettings.class)) @@ -602,11 +715,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil 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(NetworkSecurityStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NetworkSecurityStubSettings.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); @@ -653,6 +785,11 @@ protected NetworkSecurityStubSettings(Builder settingsBuilder) throws IOExceptio deleteClientTlsPolicySettings = settingsBuilder.deleteClientTlsPolicySettings().build(); deleteClientTlsPolicyOperationSettings = settingsBuilder.deleteClientTlsPolicyOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for NetworkSecurityStubSettings. */ @@ -724,6 +861,14 @@ public static class Builder extends StubSettings.Builder deleteClientTlsPolicyOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -785,6 +930,11 @@ protected Builder(ClientContext clientContext) { updateClientTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); deleteClientTlsPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteClientTlsPolicyOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -802,7 +952,12 @@ protected Builder(ClientContext clientContext) { getClientTlsPolicySettings, createClientTlsPolicySettings, updateClientTlsPolicySettings, - deleteClientTlsPolicySettings); + deleteClientTlsPolicySettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); initDefaults(this); } @@ -842,6 +997,11 @@ protected Builder(NetworkSecurityStubSettings settings) { deleteClientTlsPolicySettings = settings.deleteClientTlsPolicySettings.toBuilder(); deleteClientTlsPolicyOperationSettings = settings.deleteClientTlsPolicyOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -859,7 +1019,12 @@ protected Builder(NetworkSecurityStubSettings settings) { getClientTlsPolicySettings, createClientTlsPolicySettings, updateClientTlsPolicySettings, - deleteClientTlsPolicySettings); + deleteClientTlsPolicySettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); } private static Builder createDefault() { @@ -875,6 +1040,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 .listAuthorizationPoliciesSettings() @@ -951,6 +1129,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .createAuthorizationPolicyOperationSettings() .setInitialCallSettings( @@ -1365,6 +1568,34 @@ public Builder applyToAllUnaryMethods( return deleteClientTlsPolicyOperationSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + @Override public NetworkSecurityStubSettings build() throws IOException { return new NetworkSecurityStubSettings(this); diff --git a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicy.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicy.java new file mode 100644 index 00000000..f1a9c766 --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicy.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.cloud.networksecurity.v1beta1; + +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 MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicyImpl.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicyImpl.java new file mode 100644 index 00000000..1546aef0 --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * 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.cloud.networksecurity.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +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 MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) 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 TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest 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 SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest 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 GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocations.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocations.java new file mode 100644 index 00000000..e9ff238b --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocations.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.cloud.networksecurity.v1beta1; + +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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocationsImpl.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocationsImpl.java new file mode 100644 index 00000000..ba75e18d --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/MockLocationsImpl.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.cloud.networksecurity.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +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 MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientHttpJsonTest.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientHttpJsonTest.java new file mode 100644 index 00000000..6ceb4a72 --- /dev/null +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientHttpJsonTest.java @@ -0,0 +1,1920 @@ +/* + * 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.cloud.networksecurity.v1beta1; + +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.stub.HttpJsonNetworkSecurityStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 NetworkSecurityClientHttpJsonTest { + private static MockHttpService mockService; + private static NetworkSecurityClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonNetworkSecurityStub.getMethodDescriptors(), + NetworkSecuritySettings.getDefaultEndpoint()); + NetworkSecuritySettings settings = + NetworkSecuritySettings.newHttpJsonBuilder() + .setTransportChannelProvider( + NetworkSecuritySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NetworkSecurityClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listAuthorizationPoliciesTest() throws Exception { + AuthorizationPolicy responsesElement = AuthorizationPolicy.newBuilder().build(); + ListAuthorizationPoliciesResponse expectedResponse = + ListAuthorizationPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizationPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAuthorizationPoliciesPagedResponse pagedListResponse = + client.listAuthorizationPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizationPoliciesList().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 listAuthorizationPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAuthorizationPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAuthorizationPoliciesTest2() throws Exception { + AuthorizationPolicy responsesElement = AuthorizationPolicy.newBuilder().build(); + ListAuthorizationPoliciesResponse expectedResponse = + ListAuthorizationPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizationPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListAuthorizationPoliciesPagedResponse pagedListResponse = + client.listAuthorizationPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizationPoliciesList().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 listAuthorizationPoliciesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listAuthorizationPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizationPolicyTest() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + + AuthorizationPolicy actualResponse = client.getAuthorizationPolicy(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 getAuthorizationPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + client.getAuthorizationPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizationPolicyTest2() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7969/locations/location-7969/authorizationPolicies/authorizationPolicie-7969"; + + AuthorizationPolicy actualResponse = client.getAuthorizationPolicy(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 getAuthorizationPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7969/locations/location-7969/authorizationPolicies/authorizationPolicie-7969"; + client.getAuthorizationPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAuthorizationPolicyTest() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + + AuthorizationPolicy actualResponse = + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .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 createAuthorizationPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createAuthorizationPolicyTest2() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + + AuthorizationPolicy actualResponse = + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .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 createAuthorizationPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); + String authorizationPolicyId = "authorizationPolicyId1314252166"; + client + .createAuthorizationPolicyAsync(parent, authorizationPolicy, authorizationPolicyId) + .get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateAuthorizationPolicyTest() throws Exception { + AuthorizationPolicy expectedResponse = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + AuthorizationPolicy authorizationPolicy = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AuthorizationPolicy actualResponse = + client.updateAuthorizationPolicyAsync(authorizationPolicy, updateMask).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 updateAuthorizationPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AuthorizationPolicy authorizationPolicy = + AuthorizationPolicy.newBuilder() + .setName( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllRules(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAuthorizationPolicyAsync(authorizationPolicy, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteAuthorizationPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + + client.deleteAuthorizationPolicyAsync(name).get(); + + 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 deleteAuthorizationPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AuthorizationPolicyName name = + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + client.deleteAuthorizationPolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteAuthorizationPolicyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAuthorizationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-7969/locations/location-7969/authorizationPolicies/authorizationPolicie-7969"; + + client.deleteAuthorizationPolicyAsync(name).get(); + + 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 deleteAuthorizationPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7969/locations/location-7969/authorizationPolicies/authorizationPolicie-7969"; + client.deleteAuthorizationPolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listServerTlsPoliciesTest() throws Exception { + ServerTlsPolicy responsesElement = ServerTlsPolicy.newBuilder().build(); + ListServerTlsPoliciesResponse expectedResponse = + ListServerTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllServerTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListServerTlsPoliciesPagedResponse pagedListResponse = client.listServerTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServerTlsPoliciesList().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 listServerTlsPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listServerTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listServerTlsPoliciesTest2() throws Exception { + ServerTlsPolicy responsesElement = ServerTlsPolicy.newBuilder().build(); + ListServerTlsPoliciesResponse expectedResponse = + ListServerTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllServerTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListServerTlsPoliciesPagedResponse pagedListResponse = client.listServerTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServerTlsPoliciesList().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 listServerTlsPoliciesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listServerTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServerTlsPolicyTest() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + + ServerTlsPolicy actualResponse = client.getServerTlsPolicy(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 getServerTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + client.getServerTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getServerTlsPolicyTest2() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7730/locations/location-7730/serverTlsPolicies/serverTlsPolicie-7730"; + + ServerTlsPolicy actualResponse = client.getServerTlsPolicy(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 getServerTlsPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7730/locations/location-7730/serverTlsPolicies/serverTlsPolicie-7730"; + client.getServerTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createServerTlsPolicyTest() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + + ServerTlsPolicy actualResponse = + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).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 createServerTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createServerTlsPolicyTest2() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + + ServerTlsPolicy actualResponse = + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).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 createServerTlsPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); + String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; + client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateServerTlsPolicyTest() throws Exception { + ServerTlsPolicy expectedResponse = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ServerTlsPolicy serverTlsPolicy = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ServerTlsPolicy actualResponse = + client.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).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 updateServerTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServerTlsPolicy serverTlsPolicy = + ServerTlsPolicy.newBuilder() + .setName( + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setAllowOpen(true) + .setServerCertificate(CertificateProvider.newBuilder().build()) + .setMtlsPolicy(ServerTlsPolicy.MTLSPolicy.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateServerTlsPolicyAsync(serverTlsPolicy, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteServerTlsPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + + client.deleteServerTlsPolicyAsync(name).get(); + + 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 deleteServerTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServerTlsPolicyName name = + ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + client.deleteServerTlsPolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteServerTlsPolicyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteServerTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-7730/locations/location-7730/serverTlsPolicies/serverTlsPolicie-7730"; + + client.deleteServerTlsPolicyAsync(name).get(); + + 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 deleteServerTlsPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7730/locations/location-7730/serverTlsPolicies/serverTlsPolicie-7730"; + client.deleteServerTlsPolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listClientTlsPoliciesTest() throws Exception { + ClientTlsPolicy responsesElement = ClientTlsPolicy.newBuilder().build(); + ListClientTlsPoliciesResponse expectedResponse = + ListClientTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllClientTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListClientTlsPoliciesPagedResponse pagedListResponse = client.listClientTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClientTlsPoliciesList().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 listClientTlsPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listClientTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listClientTlsPoliciesTest2() throws Exception { + ClientTlsPolicy responsesElement = ClientTlsPolicy.newBuilder().build(); + ListClientTlsPoliciesResponse expectedResponse = + ListClientTlsPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllClientTlsPolicies(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListClientTlsPoliciesPagedResponse pagedListResponse = client.listClientTlsPolicies(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getClientTlsPoliciesList().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 listClientTlsPoliciesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listClientTlsPolicies(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClientTlsPolicyTest() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + + ClientTlsPolicy actualResponse = client.getClientTlsPolicy(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 getClientTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + client.getClientTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getClientTlsPolicyTest2() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6614/locations/location-6614/clientTlsPolicies/clientTlsPolicie-6614"; + + ClientTlsPolicy actualResponse = client.getClientTlsPolicy(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 getClientTlsPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6614/locations/location-6614/clientTlsPolicies/clientTlsPolicie-6614"; + client.getClientTlsPolicy(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createClientTlsPolicyTest() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + + ClientTlsPolicy actualResponse = + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).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 createClientTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createClientTlsPolicyTest2() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + + ClientTlsPolicy actualResponse = + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).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 createClientTlsPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); + String clientTlsPolicyId = "clientTlsPolicyId-188933315"; + client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateClientTlsPolicyTest() throws Exception { + ClientTlsPolicy expectedResponse = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClientTlsPolicy clientTlsPolicy = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ClientTlsPolicy actualResponse = + client.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).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 updateClientTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClientTlsPolicy clientTlsPolicy = + ClientTlsPolicy.newBuilder() + .setName( + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setSni("sni114030") + .setClientCertificate(CertificateProvider.newBuilder().build()) + .addAllServerValidationCa(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateClientTlsPolicyAsync(clientTlsPolicy, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClientTlsPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + + client.deleteClientTlsPolicyAsync(name).get(); + + 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 deleteClientTlsPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ClientTlsPolicyName name = + ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + client.deleteClientTlsPolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteClientTlsPolicyTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteClientTlsPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-6614/locations/location-6614/clientTlsPolicies/clientTlsPolicie-6614"; + + client.deleteClientTlsPolicyAsync(name).get(); + + 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 deleteClientTlsPolicyExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6614/locations/location-6614/clientTlsPolicies/clientTlsPolicie-6614"; + client.deleteClientTlsPolicyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().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 listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + 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 getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + 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 setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + 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 getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + 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 testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientTest.java b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientTest.java index bf7883c3..3863fc46 100644 --- a/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientTest.java +++ b/google-cloud-network-security/src/test/java/com/google/cloud/networksecurity/v1beta1/NetworkSecurityClientTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListClientTlsPoliciesPagedResponse; +import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListLocationsPagedResponse; import static com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient.ListServerTlsPoliciesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -28,10 +29,23 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.ByteString; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; @@ -53,6 +67,8 @@ @Generated("by gapic-generator-java") public class NetworkSecurityClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockNetworkSecurity mockNetworkSecurity; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; @@ -61,9 +77,12 @@ public class NetworkSecurityClientTest { @BeforeClass public static void startStaticServer() { mockNetworkSecurity = new MockNetworkSecurity(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockNetworkSecurity)); + UUID.randomUUID().toString(), + Arrays.asList(mockNetworkSecurity, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -296,8 +315,7 @@ public void createAuthorizationPolicyTest() throws Exception { .build(); mockNetworkSecurity.addResponse(resultOperation); - AuthorizationPolicyName parent = - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); String authorizationPolicyId = "authorizationPolicyId1314252166"; @@ -327,8 +345,7 @@ public void createAuthorizationPolicyExceptionTest() throws Exception { mockNetworkSecurity.addException(exception); try { - AuthorizationPolicyName parent = - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); String authorizationPolicyId = "authorizationPolicyId1314252166"; client @@ -759,8 +776,7 @@ public void createServerTlsPolicyTest() throws Exception { .build(); mockNetworkSecurity.addResponse(resultOperation); - ServerTlsPolicyName parent = - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; @@ -788,8 +804,7 @@ public void createServerTlsPolicyExceptionTest() throws Exception { mockNetworkSecurity.addException(exception); try { - ServerTlsPolicyName parent = - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; client.createServerTlsPolicyAsync(parent, serverTlsPolicy, serverTlsPolicyId).get(); @@ -1216,8 +1231,7 @@ public void createClientTlsPolicyTest() throws Exception { .build(); mockNetworkSecurity.addResponse(resultOperation); - ClientTlsPolicyName parent = - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); String clientTlsPolicyId = "clientTlsPolicyId-188933315"; @@ -1245,8 +1259,7 @@ public void createClientTlsPolicyExceptionTest() throws Exception { mockNetworkSecurity.addException(exception); try { - ClientTlsPolicyName parent = - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); String clientTlsPolicyId = "clientTlsPolicyId-188933315"; client.createClientTlsPolicyAsync(parent, clientTlsPolicy, clientTlsPolicyId).get(); @@ -1466,4 +1479,265 @@ public void deleteClientTlsPolicyExceptionTest2() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicy.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicy.java index 997517ad..a74cec82 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicy.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicy.java @@ -377,10 +377,10 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -393,10 +393,10 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -408,10 +408,10 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -423,10 +423,10 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -441,10 +441,10 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -458,9 +458,9 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -475,9 +475,9 @@ public interface RuleOrBuilder * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -492,9 +492,9 @@ com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Destination ge * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -508,9 +508,9 @@ com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Destination ge * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -528,9 +528,9 @@ com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Destination ge * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -679,11 +679,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -696,11 +696,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -713,11 +713,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -731,11 +731,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -750,11 +750,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -766,11 +766,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -782,11 +782,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -799,11 +799,11 @@ public interface SourceOrBuilder * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -937,11 +937,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -956,11 +956,11 @@ public com.google.protobuf.ProtocolStringList getPrincipalsList() { * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -975,11 +975,11 @@ public int getPrincipalsCount() { * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -995,11 +995,11 @@ public java.lang.String getPrincipals(int index) { * * *
-       * Optional. List of peer identities to match for authorization. At least one
-       * principal should match. Each peer can be an exact match, or a prefix
-       * match (example, "namespace/*") or a suffix match (example, //
-       * */service-account") or a presence match "*". Authorization based on the
-       * principal name without certificate validation (configured by
+       * Optional. List of peer identities to match for authorization. At least
+       * one principal should match. Each peer can be an exact match, or a
+       * prefix match (example, "namespace/*") or a suffix match (example,
+       * "*/service-account") or a presence match "*". Authorization based on
+       * the principal name without certificate validation (configured by
        * ServerTlsPolicy resource) is considered insecure.
        * 
* @@ -1018,11 +1018,11 @@ public com.google.protobuf.ByteString getPrincipalsBytes(int index) { * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1036,11 +1036,11 @@ public com.google.protobuf.ProtocolStringList getIpBlocksList() { * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1054,11 +1054,11 @@ public int getIpBlocksCount() { * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1073,11 +1073,11 @@ public java.lang.String getIpBlocks(int index) { * * *
-       * Optional. List of CIDR ranges to match based on source IP address. At least one
-       * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-       * "1.2.3.0/24") are supported. Authorization based on source IP alone
-       * should be avoided. The IP addresses of any load balancers or proxies
-       * should be considered untrusted.
+       * Optional. List of CIDR ranges to match based on source IP address. At
+       * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+       * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+       * alone should be avoided. The IP addresses of any load balancers or
+       * proxies should be considered untrusted.
        * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1499,11 +1499,11 @@ private void ensurePrincipalsIsMutable() { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1518,11 +1518,11 @@ public com.google.protobuf.ProtocolStringList getPrincipalsList() { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1537,11 +1537,11 @@ public int getPrincipalsCount() { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1557,11 +1557,11 @@ public java.lang.String getPrincipals(int index) { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1577,11 +1577,11 @@ public com.google.protobuf.ByteString getPrincipalsBytes(int index) { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1604,11 +1604,11 @@ public Builder setPrincipals(int index, java.lang.String value) { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1630,11 +1630,11 @@ public Builder addPrincipals(java.lang.String value) { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1653,11 +1653,11 @@ public Builder addAllPrincipals(java.lang.Iterable values) { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1675,11 +1675,11 @@ public Builder clearPrincipals() { * * *
-         * Optional. List of peer identities to match for authorization. At least one
-         * principal should match. Each peer can be an exact match, or a prefix
-         * match (example, "namespace/*") or a suffix match (example, //
-         * */service-account") or a presence match "*". Authorization based on the
-         * principal name without certificate validation (configured by
+         * Optional. List of peer identities to match for authorization. At least
+         * one principal should match. Each peer can be an exact match, or a
+         * prefix match (example, "namespace/*") or a suffix match (example,
+         * "*/service-account") or a presence match "*". Authorization based on
+         * the principal name without certificate validation (configured by
          * ServerTlsPolicy resource) is considered insecure.
          * 
* @@ -1712,11 +1712,11 @@ private void ensureIpBlocksIsMutable() { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1730,11 +1730,11 @@ public com.google.protobuf.ProtocolStringList getIpBlocksList() { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1748,11 +1748,11 @@ public int getIpBlocksCount() { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1767,11 +1767,11 @@ public java.lang.String getIpBlocks(int index) { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1786,11 +1786,11 @@ public com.google.protobuf.ByteString getIpBlocksBytes(int index) { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1812,11 +1812,11 @@ public Builder setIpBlocks(int index, java.lang.String value) { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1837,11 +1837,11 @@ public Builder addIpBlocks(java.lang.String value) { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1859,11 +1859,11 @@ public Builder addAllIpBlocks(java.lang.Iterable values) { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1880,11 +1880,11 @@ public Builder clearIpBlocks() { * * *
-         * Optional. List of CIDR ranges to match based on source IP address. At least one
-         * IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
-         * "1.2.3.0/24") are supported. Authorization based on source IP alone
-         * should be avoided. The IP addresses of any load balancers or proxies
-         * should be considered untrusted.
+         * Optional. List of CIDR ranges to match based on source IP address. At
+         * least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
+         * (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
+         * alone should be avoided. The IP addresses of any load balancers or
+         * proxies should be considered untrusted.
          * 
* * repeated string ip_blocks = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1968,10 +1968,10 @@ public interface DestinationOrBuilder * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1983,10 +1983,10 @@ public interface DestinationOrBuilder * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1998,10 +1998,10 @@ public interface DestinationOrBuilder * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2014,10 +2014,10 @@ public interface DestinationOrBuilder * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -2031,7 +2031,8 @@ public interface DestinationOrBuilder * * *
-       * Required. List of destination ports to match. At least one port should match.
+       * Required. List of destination ports to match. At least one port should
+       * match.
        * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2043,7 +2044,8 @@ public interface DestinationOrBuilder * * *
-       * Required. List of destination ports to match. At least one port should match.
+       * Required. List of destination ports to match. At least one port should
+       * match.
        * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2055,7 +2057,8 @@ public interface DestinationOrBuilder * * *
-       * Required. List of destination ports to match. At least one port should match.
+       * Required. List of destination ports to match. At least one port should
+       * match.
        * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2124,11 +2127,11 @@ public interface DestinationOrBuilder * * *
-       * Optional. Match against key:value pair in http header. Provides a flexible match
-       * based on HTTP headers, for potentially advanced use cases. At least one
-       * header should match. Avoid using header matches to make authorization
-       * decisions unless there is a strong guarantee that requests arrive
-       * through a trusted client or proxy.
+       * Optional. Match against key:value pair in http header. Provides a
+       * flexible match based on HTTP headers, for potentially advanced use
+       * cases. At least one header should match. Avoid using header matches to
+       * make authorization decisions unless there is a strong guarantee that
+       * requests arrive through a trusted client or proxy.
        * 
* * @@ -2142,11 +2145,11 @@ public interface DestinationOrBuilder * * *
-       * Optional. Match against key:value pair in http header. Provides a flexible match
-       * based on HTTP headers, for potentially advanced use cases. At least one
-       * header should match. Avoid using header matches to make authorization
-       * decisions unless there is a strong guarantee that requests arrive
-       * through a trusted client or proxy.
+       * Optional. Match against key:value pair in http header. Provides a
+       * flexible match based on HTTP headers, for potentially advanced use
+       * cases. At least one header should match. Avoid using header matches to
+       * make authorization decisions unless there is a strong guarantee that
+       * requests arrive through a trusted client or proxy.
        * 
* * @@ -2161,11 +2164,11 @@ public interface DestinationOrBuilder * * *
-       * Optional. Match against key:value pair in http header. Provides a flexible match
-       * based on HTTP headers, for potentially advanced use cases. At least one
-       * header should match. Avoid using header matches to make authorization
-       * decisions unless there is a strong guarantee that requests arrive
-       * through a trusted client or proxy.
+       * Optional. Match against key:value pair in http header. Provides a
+       * flexible match based on HTTP headers, for potentially advanced use
+       * cases. At least one header should match. Avoid using header matches to
+       * make authorization decisions unless there is a strong guarantee that
+       * requests arrive through a trusted client or proxy.
        * 
* * @@ -2441,7 +2444,7 @@ public interface HttpHeaderMatchOrBuilder * * *
-       * Specification of HTTP header match atrributes.
+       * Specification of HTTP header match attributes.
        * 
* * Protobuf type {@code @@ -2949,7 +2952,7 @@ protected Builder newBuilderForType( * * *
-         * Specification of HTTP header match atrributes.
+         * Specification of HTTP header match attributes.
          * 
* * Protobuf type {@code @@ -3528,10 +3531,10 @@ public com.google.protobuf.Parser getParserForType() { * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3545,10 +3548,10 @@ public com.google.protobuf.ProtocolStringList getHostsList() { * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3562,10 +3565,10 @@ public int getHostsCount() { * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3580,10 +3583,10 @@ public java.lang.String getHosts(int index) { * * *
-       * Required. List of host names to match. Matched against the ":authority" header in
-       * http requests. At least one host should match. Each host can be an
-       * exact match, or a prefix match (example "mydomain.*") or a suffix
-       * match (example // *.myorg.com") or a presence(any) match "*".
+       * Required. List of host names to match. Matched against the ":authority"
+       * header in http requests. At least one host should match. Each host can
+       * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+       * match (example "*.myorg.com") or a presence (any) match "*".
        * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -3601,7 +3604,8 @@ public com.google.protobuf.ByteString getHostsBytes(int index) { * * *
-       * Required. List of destination ports to match. At least one port should match.
+       * Required. List of destination ports to match. At least one port should
+       * match.
        * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -3616,7 +3620,8 @@ public java.util.List getPortsList() { * * *
-       * Required. List of destination ports to match. At least one port should match.
+       * Required. List of destination ports to match. At least one port should
+       * match.
        * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -3630,7 +3635,8 @@ public int getPortsCount() { * * *
-       * Required. List of destination ports to match. At least one port should match.
+       * Required. List of destination ports to match. At least one port should
+       * match.
        * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -3717,11 +3723,11 @@ public com.google.protobuf.ByteString getMethodsBytes(int index) { * * *
-       * Optional. Match against key:value pair in http header. Provides a flexible match
-       * based on HTTP headers, for potentially advanced use cases. At least one
-       * header should match. Avoid using header matches to make authorization
-       * decisions unless there is a strong guarantee that requests arrive
-       * through a trusted client or proxy.
+       * Optional. Match against key:value pair in http header. Provides a
+       * flexible match based on HTTP headers, for potentially advanced use
+       * cases. At least one header should match. Avoid using header matches to
+       * make authorization decisions unless there is a strong guarantee that
+       * requests arrive through a trusted client or proxy.
        * 
* * @@ -3738,11 +3744,11 @@ public boolean hasHttpHeaderMatch() { * * *
-       * Optional. Match against key:value pair in http header. Provides a flexible match
-       * based on HTTP headers, for potentially advanced use cases. At least one
-       * header should match. Avoid using header matches to make authorization
-       * decisions unless there is a strong guarantee that requests arrive
-       * through a trusted client or proxy.
+       * Optional. Match against key:value pair in http header. Provides a
+       * flexible match based on HTTP headers, for potentially advanced use
+       * cases. At least one header should match. Avoid using header matches to
+       * make authorization decisions unless there is a strong guarantee that
+       * requests arrive through a trusted client or proxy.
        * 
* * @@ -3764,11 +3770,11 @@ public boolean hasHttpHeaderMatch() { * * *
-       * Optional. Match against key:value pair in http header. Provides a flexible match
-       * based on HTTP headers, for potentially advanced use cases. At least one
-       * header should match. Avoid using header matches to make authorization
-       * decisions unless there is a strong guarantee that requests arrive
-       * through a trusted client or proxy.
+       * Optional. Match against key:value pair in http header. Provides a
+       * flexible match based on HTTP headers, for potentially advanced use
+       * cases. At least one header should match. Avoid using header matches to
+       * make authorization decisions unless there is a strong guarantee that
+       * requests arrive through a trusted client or proxy.
        * 
* * @@ -4270,10 +4276,10 @@ private void ensureHostsIsMutable() { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4287,10 +4293,10 @@ public com.google.protobuf.ProtocolStringList getHostsList() { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4304,10 +4310,10 @@ public int getHostsCount() { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4322,10 +4328,10 @@ public java.lang.String getHosts(int index) { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4340,10 +4346,10 @@ public com.google.protobuf.ByteString getHostsBytes(int index) { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4365,10 +4371,10 @@ public Builder setHosts(int index, java.lang.String value) { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4389,10 +4395,10 @@ public Builder addHosts(java.lang.String value) { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4410,10 +4416,10 @@ public Builder addAllHosts(java.lang.Iterable values) { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4430,10 +4436,10 @@ public Builder clearHosts() { * * *
-         * Required. List of host names to match. Matched against the ":authority" header in
-         * http requests. At least one host should match. Each host can be an
-         * exact match, or a prefix match (example "mydomain.*") or a suffix
-         * match (example // *.myorg.com") or a presence(any) match "*".
+         * Required. List of host names to match. Matched against the ":authority"
+         * header in http requests. At least one host should match. Each host can
+         * be an exact match, or a prefix match (example "mydomain.*") or a suffix
+         * match (example "*.myorg.com") or a presence (any) match "*".
          * 
* * repeated string hosts = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -4464,7 +4470,8 @@ private void ensurePortsIsMutable() { * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4480,7 +4487,8 @@ public java.util.List getPortsList() { * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4494,7 +4502,8 @@ public int getPortsCount() { * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4509,7 +4518,8 @@ public int getPorts(int index) { * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4528,7 +4538,8 @@ public Builder setPorts(int index, int value) { * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4546,7 +4557,8 @@ public Builder addPorts(int value) { * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4564,7 +4576,8 @@ public Builder addAllPorts(java.lang.Iterable value * * *
-         * Required. List of destination ports to match. At least one port should match.
+         * Required. List of destination ports to match. At least one port should
+         * match.
          * 
* * repeated uint32 ports = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -4770,11 +4783,11 @@ public Builder addMethodsBytes(com.google.protobuf.ByteString value) { * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4790,11 +4803,11 @@ public boolean hasHttpHeaderMatch() { * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4819,11 +4832,11 @@ public boolean hasHttpHeaderMatch() { * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4850,11 +4863,11 @@ public Builder setHttpHeaderMatch( * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4878,11 +4891,11 @@ public Builder setHttpHeaderMatch( * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4914,11 +4927,11 @@ public Builder mergeHttpHeaderMatch( * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4940,11 +4953,11 @@ public Builder clearHttpHeaderMatch() { * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4962,11 +4975,11 @@ public Builder clearHttpHeaderMatch() { * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -4989,11 +5002,11 @@ public Builder clearHttpHeaderMatch() { * * *
-         * Optional. Match against key:value pair in http header. Provides a flexible match
-         * based on HTTP headers, for potentially advanced use cases. At least one
-         * header should match. Avoid using header matches to make authorization
-         * decisions unless there is a strong guarantee that requests arrive
-         * through a trusted client or proxy.
+         * Optional. Match against key:value pair in http header. Provides a
+         * flexible match based on HTTP headers, for potentially advanced use
+         * cases. At least one header should match. Avoid using header matches to
+         * make authorization decisions unless there is a strong guarantee that
+         * requests arrive through a trusted client or proxy.
          * 
* * @@ -5087,10 +5100,10 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -5106,10 +5119,10 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -5127,10 +5140,10 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -5145,10 +5158,10 @@ public int getSourcesCount() { * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -5164,10 +5177,10 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Source * * *
-     * Optional. List of attributes for the traffic source. All of the sources must match.
-     * A source is a match if both principals and ip_blocks match. If not set,
-     * the action specified in the 'action' field will be applied without any
-     * rule checks for the source.
+     * Optional. List of attributes for the traffic source. All of the sources
+     * must match. A source is a match if both principals and ip_blocks match.
+     * If not set, the action specified in the 'action' field will be applied
+     * without any rule checks for the source.
      * 
* * @@ -5188,9 +5201,9 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Source * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -5209,9 +5222,9 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Source * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -5232,9 +5245,9 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Source * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -5251,9 +5264,9 @@ public int getDestinationsCount() { * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -5271,9 +5284,9 @@ public int getDestinationsCount() { * * *
-     * Optional. List of attributes for the traffic destination. All of the destinations
-     * must match. A destination is a match if a request matches all the
-     * specified hosts, ports, methods and headers. If not set, the
+     * Optional. List of attributes for the traffic destination. All of the
+     * destinations must match. A destination is a match if a request matches
+     * all the specified hosts, ports, methods and headers. If not set, the
      * action specified in the 'action' field will be applied without any rule
      * checks for the destination.
      * 
@@ -5739,10 +5752,10 @@ private void ensureSourcesIsMutable() { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5762,10 +5775,10 @@ private void ensureSourcesIsMutable() { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5783,10 +5796,10 @@ public int getSourcesCount() { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5805,10 +5818,10 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule.Source * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5834,10 +5847,10 @@ public Builder setSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5861,10 +5874,10 @@ public Builder setSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5889,10 +5902,10 @@ public Builder addSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5918,10 +5931,10 @@ public Builder addSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5944,10 +5957,10 @@ public Builder addSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5971,10 +5984,10 @@ public Builder addSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -5999,10 +6012,10 @@ public Builder addAllSources( * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6023,10 +6036,10 @@ public Builder clearSources() { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6047,10 +6060,10 @@ public Builder removeSources(int index) { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6065,10 +6078,10 @@ public Builder removeSources(int index) { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6087,10 +6100,10 @@ public Builder removeSources(int index) { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6111,10 +6124,10 @@ public Builder removeSources(int index) { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6132,10 +6145,10 @@ public Builder removeSources(int index) { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6154,10 +6167,10 @@ public Builder removeSources(int index) { * * *
-       * Optional. List of attributes for the traffic source. All of the sources must match.
-       * A source is a match if both principals and ip_blocks match. If not set,
-       * the action specified in the 'action' field will be applied without any
-       * rule checks for the source.
+       * Optional. List of attributes for the traffic source. All of the sources
+       * must match. A source is a match if both principals and ip_blocks match.
+       * If not set, the action specified in the 'action' field will be applied
+       * without any rule checks for the source.
        * 
* * @@ -6213,9 +6226,9 @@ private void ensureDestinationsIsMutable() { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6237,9 +6250,9 @@ private void ensureDestinationsIsMutable() { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6259,9 +6272,9 @@ public int getDestinationsCount() { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6282,9 +6295,9 @@ public int getDestinationsCount() { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6312,9 +6325,9 @@ public Builder setDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6340,9 +6353,9 @@ public Builder setDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6369,9 +6382,9 @@ public Builder addDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6399,9 +6412,9 @@ public Builder addDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6426,9 +6439,9 @@ public Builder addDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6454,9 +6467,9 @@ public Builder addDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6483,9 +6496,9 @@ public Builder addAllDestinations( * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6508,9 +6521,9 @@ public Builder clearDestinations() { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6533,9 +6546,9 @@ public Builder removeDestinations(int index) { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6552,9 +6565,9 @@ public Builder removeDestinations(int index) { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6575,9 +6588,9 @@ public Builder removeDestinations(int index) { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6601,9 +6614,9 @@ public Builder removeDestinations(int index) { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6623,9 +6636,9 @@ public Builder removeDestinations(int index) { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6646,9 +6659,9 @@ public Builder removeDestinations(int index) { * * *
-       * Optional. List of attributes for the traffic destination. All of the destinations
-       * must match. A destination is a match if a request matches all the
-       * specified hosts, ports, methods and headers. If not set, the
+       * Optional. List of attributes for the traffic destination. All of the
+       * destinations must match. A destination is a match if a request matches
+       * all the specified hosts, ports, methods and headers. If not set, the
        * action specified in the 'action' field will be applied without any rule
        * checks for the destination.
        * 
@@ -6968,7 +6981,8 @@ public int getLabelsCount() { * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -6990,7 +7004,8 @@ public java.util.Map getLabels() { * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -7003,7 +7018,8 @@ public java.util.Map getLabelsMap() { * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -7020,7 +7036,8 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -7087,10 +7104,11 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Action getAc * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -7106,10 +7124,11 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Action getAc * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -7126,10 +7145,11 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Action getAc * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -7144,10 +7164,11 @@ public int getRulesCount() { * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -7162,10 +7183,11 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule getRule * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -8340,7 +8362,8 @@ public int getLabelsCount() { * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8362,7 +8385,8 @@ public java.util.Map getLabels() { * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8375,7 +8399,8 @@ public java.util.Map getLabelsMap() { * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8393,7 +8418,8 @@ public java.lang.String getLabelsOrDefault( * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8418,7 +8444,8 @@ public Builder clearLabels() { * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8439,7 +8466,8 @@ public java.util.Map getMutableLabels() { * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8459,7 +8487,8 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * * *
-     * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+     * Optional. Set of label tags associated with the AuthorizationPolicy
+     * resource.
      * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -8600,10 +8629,11 @@ private void ensureRulesIsMutable() { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8622,10 +8652,11 @@ private void ensureRulesIsMutable() { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8643,10 +8674,11 @@ public int getRulesCount() { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8664,10 +8696,11 @@ public com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy.Rule getRule * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8692,10 +8725,11 @@ public Builder setRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8718,10 +8752,11 @@ public Builder setRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8746,10 +8781,11 @@ public Builder addRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8774,10 +8810,11 @@ public Builder addRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8799,10 +8836,11 @@ public Builder addRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8825,10 +8863,11 @@ public Builder addRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8852,10 +8891,11 @@ public Builder addAllRules( * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8876,10 +8916,11 @@ public Builder clearRules() { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8900,10 +8941,11 @@ public Builder removeRules(int index) { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8918,10 +8960,11 @@ public Builder removeRules(int index) { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8940,10 +8983,11 @@ public Builder removeRules(int index) { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8963,10 +9007,11 @@ public Builder removeRules(int index) { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -8984,10 +9029,11 @@ public Builder removeRules(int index) { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * @@ -9006,10 +9052,11 @@ public Builder removeRules(int index) { * * *
-     * Optional. List of rules to match. Note that at least one of the rules must match in
-     * order for the action specified in the 'action' field to be taken. A rule is
-     * a match if there is a matching source and destination. If left blank, the
-     * action specified in the `action` field will be applied on every request.
+     * Optional. List of rules to match. Note that at least one of the rules must
+     * match in order for the action specified in the 'action' field to be taken.
+     * A rule is a match if there is a matching source and destination. If left
+     * blank, the action specified in the `action` field will be applied on every
+     * request.
      * 
* * diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyOrBuilder.java index fb8ebbfd..b4af2d77 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyOrBuilder.java @@ -155,7 +155,8 @@ public interface AuthorizationPolicyOrBuilder * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -165,7 +166,8 @@ public interface AuthorizationPolicyOrBuilder * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -178,7 +180,8 @@ public interface AuthorizationPolicyOrBuilder * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -188,7 +191,8 @@ public interface AuthorizationPolicyOrBuilder * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -203,7 +207,8 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Set of label tags associated with the AuthorizationPolicy resource.
+   * Optional. Set of label tags associated with the AuthorizationPolicy
+   * resource.
    * 
* * map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL]; @@ -245,10 +250,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -260,10 +266,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -275,10 +282,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -290,10 +298,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * @@ -307,10 +316,11 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. List of rules to match. Note that at least one of the rules must match in
-   * order for the action specified in the 'action' field to be taken. A rule is
-   * a match if there is a matching source and destination. If left blank, the
-   * action specified in the `action` field will be applied on every request.
+   * Optional. List of rules to match. Note that at least one of the rules must
+   * match in order for the action specified in the 'action' field to be taken.
+   * A rule is a match if there is a matching source and destination. If left
+   * blank, the action specified in the `action` field will be applied on every
+   * request.
    * 
* * diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyProto.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyProto.java index f365aff7..ac66c7a9 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyProto.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/AuthorizationPolicyProto.java @@ -89,69 +89,69 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "networksecurity.v1beta1\032\037google/api/fiel" + "d_behavior.proto\032\031google/api/resource.pr" + "oto\032 google/protobuf/field_mask.proto\032\037g" - + "oogle/protobuf/timestamp.proto\032\034google/a" - + "pi/annotations.proto\"\317\t\n\023AuthorizationPo" - + "licy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013description\030\002" - + " \001(\tB\003\340A\001\0224\n\013create_time\030\003 \001(\0132\032.google." - + "protobuf.TimestampB\003\340A\003\0224\n\013update_time\030\004" - + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022Z\n" - + "\006labels\030\005 \003(\0132E.google.cloud.networksecu" - + "rity.v1beta1.AuthorizationPolicy.LabelsE" - + "ntryB\003\340A\001\022U\n\006action\030\006 \001(\0162@.google.cloud" - + ".networksecurity.v1beta1.AuthorizationPo" - + "licy.ActionB\003\340A\002\022R\n\005rules\030\007 \003(\0132>.google" - + ".cloud.networksecurity.v1beta1.Authoriza" - + "tionPolicy.RuleB\003\340A\001\032\240\004\n\004Rule\022[\n\007sources" - + "\030\001 \003(\0132E.google.cloud.networksecurity.v1" - + "beta1.AuthorizationPolicy.Rule.SourceB\003\340" - + "A\001\022e\n\014destinations\030\002 \003(\0132J.google.cloud." - + "networksecurity.v1beta1.AuthorizationPol" - + "icy.Rule.DestinationB\003\340A\001\0329\n\006Source\022\027\n\np" - + "rincipals\030\001 \003(\tB\003\340A\001\022\026\n\tip_blocks\030\002 \003(\tB" - + "\003\340A\001\032\230\002\n\013Destination\022\022\n\005hosts\030\001 \003(\tB\003\340A\002" - + "\022\022\n\005ports\030\002 \003(\rB\003\340A\002\022\024\n\007methods\030\004 \003(\tB\003\340" - + "A\001\022z\n\021http_header_match\030\005 \001(\0132Z.google.c" + + "oogle/protobuf/timestamp.proto\"\317\t\n\023Autho" + + "rizationPolicy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013des" + + "cription\030\002 \001(\tB\003\340A\001\0224\n\013create_time\030\003 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upd" + + "ate_time\030\004 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\022Z\n\006labels\030\005 \003(\0132E.google.cloud.n" + + "etworksecurity.v1beta1.AuthorizationPoli" + + "cy.LabelsEntryB\003\340A\001\022U\n\006action\030\006 \001(\0162@.go" + + "ogle.cloud.networksecurity.v1beta1.Autho" + + "rizationPolicy.ActionB\003\340A\002\022R\n\005rules\030\007 \003(" + + "\0132>.google.cloud.networksecurity.v1beta1" + + ".AuthorizationPolicy.RuleB\003\340A\001\032\240\004\n\004Rule\022" + + "[\n\007sources\030\001 \003(\0132E.google.cloud.networks" + + "ecurity.v1beta1.AuthorizationPolicy.Rule" + + ".SourceB\003\340A\001\022e\n\014destinations\030\002 \003(\0132J.goo" + + "gle.cloud.networksecurity.v1beta1.Author" + + "izationPolicy.Rule.DestinationB\003\340A\001\0329\n\006S" + + "ource\022\027\n\nprincipals\030\001 \003(\tB\003\340A\001\022\026\n\tip_blo" + + "cks\030\002 \003(\tB\003\340A\001\032\230\002\n\013Destination\022\022\n\005hosts\030" + + "\001 \003(\tB\003\340A\002\022\022\n\005ports\030\002 \003(\rB\003\340A\002\022\024\n\007method" + + "s\030\004 \003(\tB\003\340A\001\022z\n\021http_header_match\030\005 \001(\0132" + + "Z.google.cloud.networksecurity.v1beta1.A" + + "uthorizationPolicy.Rule.Destination.Http" + + "HeaderMatchB\003\340A\001\032O\n\017HttpHeaderMatch\022\032\n\013r" + + "egex_match\030\002 \001(\tB\003\340A\002H\000\022\030\n\013header_name\030\001" + + " \001(\tB\003\340A\002B\006\n\004type\032-\n\013LabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"5\n\006Action\022\026\n\022AC" + + "TION_UNSPECIFIED\020\000\022\t\n\005ALLOW\020\001\022\010\n\004DENY\020\002:" + + "\216\001\352A\212\001\n2networksecurity.googleapis.com/A" + + "uthorizationPolicy\022Tprojects/{project}/l" + + "ocations/{location}/authorizationPolicie" + + "s/{authorization_policy}\"\204\001\n ListAuthori" + + "zationPoliciesRequest\0229\n\006parent\030\001 \001(\tB)\340" + + "A\002\372A#\n!locations.googleapis.com/Location" + + "\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"" + + "\227\001\n!ListAuthorizationPoliciesResponse\022Y\n" + + "\026authorization_policies\030\001 \003(\01329.google.c" + "loud.networksecurity.v1beta1.Authorizati" - + "onPolicy.Rule.Destination.HttpHeaderMatc" - + "hB\003\340A\001\032O\n\017HttpHeaderMatch\022\032\n\013regex_match" - + "\030\002 \001(\tB\003\340A\002H\000\022\030\n\013header_name\030\001 \001(\tB\003\340A\002B" - + "\006\n\004type\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" - + "alue\030\002 \001(\t:\0028\001\"5\n\006Action\022\026\n\022ACTION_UNSPE" - + "CIFIED\020\000\022\t\n\005ALLOW\020\001\022\010\n\004DENY\020\002:\216\001\352A\212\001\n2ne" - + "tworksecurity.googleapis.com/Authorizati" - + "onPolicy\022Tprojects/{project}/locations/{" - + "location}/authorizationPolicies/{authori" - + "zation_policy}\"\204\001\n ListAuthorizationPoli" - + "ciesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!loc" - + "ations.googleapis.com/Location\022\021\n\tpage_s" - + "ize\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\227\001\n!ListAu" - + "thorizationPoliciesResponse\022Y\n\026authoriza" - + "tion_policies\030\001 \003(\01329.google.cloud.netwo" - + "rksecurity.v1beta1.AuthorizationPolicy\022\027" - + "\n\017next_page_token\030\002 \001(\t\"i\n\035GetAuthorizat" - + "ionPolicyRequest\022H\n\004name\030\001 \001(\tB:\340A\002\372A4\n2" - + "networksecurity.googleapis.com/Authoriza" - + "tionPolicy\"\362\001\n CreateAuthorizationPolicy" - + "Request\022J\n\006parent\030\001 \001(\tB:\340A\002\372A4\n2network" - + "security.googleapis.com/AuthorizationPol" - + "icy\022$\n\027authorization_policy_id\030\002 \001(\tB\003\340A" - + "\002\022\\\n\024authorization_policy\030\003 \001(\01329.google" - + ".cloud.networksecurity.v1beta1.Authoriza" - + "tionPolicyB\003\340A\002\"\266\001\n UpdateAuthorizationP" - + "olicyRequest\0224\n\013update_mask\030\001 \001(\0132\032.goog" - + "le.protobuf.FieldMaskB\003\340A\001\022\\\n\024authorizat" - + "ion_policy\030\002 \001(\01329.google.cloud.networks" - + "ecurity.v1beta1.AuthorizationPolicyB\003\340A\002" - + "\"l\n DeleteAuthorizationPolicyRequest\022H\n\004" - + "name\030\001 \001(\tB:\340A\002\372A4\n2networksecurity.goog" - + "leapis.com/AuthorizationPolicyB\223\002\n(com.g" - + "oogle.cloud.networksecurity.v1beta1B\030Aut" - + "horizationPolicyProtoP\001ZSgoogle.golang.o" - + "rg/genproto/googleapis/cloud/networksecu" - + "rity/v1beta1;networksecurity\252\002$Google.Cl" - + "oud.NetworkSecurity.V1Beta1\312\002$Google\\Clo" - + "ud\\NetworkSecurity\\V1beta1\352\002\'Google::Clo" - + "ud::NetworkSecurity::V1beta1b\006proto3" + + "onPolicy\022\027\n\017next_page_token\030\002 \001(\t\"i\n\035Get" + + "AuthorizationPolicyRequest\022H\n\004name\030\001 \001(\t" + + "B:\340A\002\372A4\n2networksecurity.googleapis.com" + + "/AuthorizationPolicy\"\362\001\n CreateAuthoriza" + + "tionPolicyRequest\022J\n\006parent\030\001 \001(\tB:\340A\002\372A" + + "4\0222networksecurity.googleapis.com/Author" + + "izationPolicy\022$\n\027authorization_policy_id" + + "\030\002 \001(\tB\003\340A\002\022\\\n\024authorization_policy\030\003 \001(" + + "\01329.google.cloud.networksecurity.v1beta1" + + ".AuthorizationPolicyB\003\340A\002\"\266\001\n UpdateAuth" + + "orizationPolicyRequest\0224\n\013update_mask\030\001 " + + "\001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\022\\\n\024" + + "authorization_policy\030\002 \001(\01329.google.clou" + + "d.networksecurity.v1beta1.AuthorizationP" + + "olicyB\003\340A\002\"l\n DeleteAuthorizationPolicyR" + + "equest\022H\n\004name\030\001 \001(\tB:\340A\002\372A4\n2networksec" + + "urity.googleapis.com/AuthorizationPolicy" + + "B\223\002\n(com.google.cloud.networksecurity.v1" + + "beta1B\030AuthorizationPolicyProtoP\001ZSgoogl" + + "e.golang.org/genproto/googleapis/cloud/n" + + "etworksecurity/v1beta1;networksecurity\252\002" + + "$Google.Cloud.NetworkSecurity.V1Beta1\312\002$" + + "Google\\Cloud\\NetworkSecurity\\V1beta1\352\002\'G" + + "oogle::Cloud::NetworkSecurity::V1beta1b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -161,7 +161,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_networksecurity_v1beta1_AuthorizationPolicy_descriptor = getDescriptor().getMessageTypes().get(0); @@ -280,7 +279,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstance.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstance.java index b793da92..d455e8ab 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstance.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstance.java @@ -122,9 +122,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. Plugin instance name, used to locate and load CertificateProvider instance
-   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-   * Authority Service certificate provider instance.
+   * Required. Plugin instance name, used to locate and load CertificateProvider
+   * instance configuration. Set to "google_cloud_private_spiffe" to use
+   * Certificate Authority Service certificate provider instance.
    * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -147,9 +147,9 @@ public java.lang.String getPluginInstance() { * * *
-   * Required. Plugin instance name, used to locate and load CertificateProvider instance
-   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-   * Authority Service certificate provider instance.
+   * Required. Plugin instance name, used to locate and load CertificateProvider
+   * instance configuration. Set to "google_cloud_private_spiffe" to use
+   * Certificate Authority Service certificate provider instance.
    * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -504,9 +504,9 @@ public Builder mergeFrom( * * *
-     * Required. Plugin instance name, used to locate and load CertificateProvider instance
-     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-     * Authority Service certificate provider instance.
+     * Required. Plugin instance name, used to locate and load CertificateProvider
+     * instance configuration. Set to "google_cloud_private_spiffe" to use
+     * Certificate Authority Service certificate provider instance.
      * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -528,9 +528,9 @@ public java.lang.String getPluginInstance() { * * *
-     * Required. Plugin instance name, used to locate and load CertificateProvider instance
-     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-     * Authority Service certificate provider instance.
+     * Required. Plugin instance name, used to locate and load CertificateProvider
+     * instance configuration. Set to "google_cloud_private_spiffe" to use
+     * Certificate Authority Service certificate provider instance.
      * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -552,9 +552,9 @@ public com.google.protobuf.ByteString getPluginInstanceBytes() { * * *
-     * Required. Plugin instance name, used to locate and load CertificateProvider instance
-     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-     * Authority Service certificate provider instance.
+     * Required. Plugin instance name, used to locate and load CertificateProvider
+     * instance configuration. Set to "google_cloud_private_spiffe" to use
+     * Certificate Authority Service certificate provider instance.
      * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -575,9 +575,9 @@ public Builder setPluginInstance(java.lang.String value) { * * *
-     * Required. Plugin instance name, used to locate and load CertificateProvider instance
-     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-     * Authority Service certificate provider instance.
+     * Required. Plugin instance name, used to locate and load CertificateProvider
+     * instance configuration. Set to "google_cloud_private_spiffe" to use
+     * Certificate Authority Service certificate provider instance.
      * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -594,9 +594,9 @@ public Builder clearPluginInstance() { * * *
-     * Required. Plugin instance name, used to locate and load CertificateProvider instance
-     * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-     * Authority Service certificate provider instance.
+     * Required. Plugin instance name, used to locate and load CertificateProvider
+     * instance configuration. Set to "google_cloud_private_spiffe" to use
+     * Certificate Authority Service certificate provider instance.
      * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstanceOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstanceOrBuilder.java index dd8cae13..f419fa1e 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstanceOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CertificateProviderInstanceOrBuilder.java @@ -27,9 +27,9 @@ public interface CertificateProviderInstanceOrBuilder * * *
-   * Required. Plugin instance name, used to locate and load CertificateProvider instance
-   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-   * Authority Service certificate provider instance.
+   * Required. Plugin instance name, used to locate and load CertificateProvider
+   * instance configuration. Set to "google_cloud_private_spiffe" to use
+   * Certificate Authority Service certificate provider instance.
    * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -41,9 +41,9 @@ public interface CertificateProviderInstanceOrBuilder * * *
-   * Required. Plugin instance name, used to locate and load CertificateProvider instance
-   * configuration. Set to "google_cloud_private_spiffe" to use Certificate
-   * Authority Service certificate provider instance.
+   * Required. Plugin instance name, used to locate and load CertificateProvider
+   * instance configuration. Set to "google_cloud_private_spiffe" to use
+   * Certificate Authority Service certificate provider instance.
    * 
* * string plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicy.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicy.java index 3a9a3552..61e7d0ae 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicy.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicy.java @@ -575,8 +575,9 @@ public com.google.protobuf.ByteString getSniBytes() { * * *
-   * Optional. Defines a mechanism to provision client identity (public and private keys)
-   * for peer to peer authentication. The presence of this dictates mTLS.
+   * Optional. Defines a mechanism to provision client identity (public and
+   * private keys) for peer to peer authentication. The presence of this
+   * dictates mTLS.
    * 
* * @@ -593,8 +594,9 @@ public boolean hasClientCertificate() { * * *
-   * Optional. Defines a mechanism to provision client identity (public and private keys)
-   * for peer to peer authentication. The presence of this dictates mTLS.
+   * Optional. Defines a mechanism to provision client identity (public and
+   * private keys) for peer to peer authentication. The presence of this
+   * dictates mTLS.
    * 
* * @@ -613,8 +615,9 @@ public com.google.cloud.networksecurity.v1beta1.CertificateProvider getClientCer * * *
-   * Optional. Defines a mechanism to provision client identity (public and private keys)
-   * for peer to peer authentication. The presence of this dictates mTLS.
+   * Optional. Defines a mechanism to provision client identity (public and
+   * private keys) for peer to peer authentication. The presence of this
+   * dictates mTLS.
    * 
* * @@ -633,9 +636,9 @@ public com.google.cloud.networksecurity.v1beta1.CertificateProvider getClientCer * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -651,9 +654,9 @@ public com.google.cloud.networksecurity.v1beta1.CertificateProvider getClientCer * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -669,9 +672,9 @@ public com.google.cloud.networksecurity.v1beta1.CertificateProvider getClientCer * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -686,9 +689,9 @@ public int getServerValidationCaCount() { * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -703,9 +706,9 @@ public com.google.cloud.networksecurity.v1beta1.ValidationCA getServerValidation * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -2153,8 +2156,9 @@ public Builder setSniBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2170,8 +2174,9 @@ public boolean hasClientCertificate() { * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2193,8 +2198,9 @@ public com.google.cloud.networksecurity.v1beta1.CertificateProvider getClientCer * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2219,8 +2225,9 @@ public Builder setClientCertificate( * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2242,8 +2249,9 @@ public Builder setClientCertificate( * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2273,8 +2281,9 @@ public Builder mergeClientCertificate( * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2296,8 +2305,9 @@ public Builder clearClientCertificate() { * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2314,8 +2324,9 @@ public Builder clearClientCertificate() { * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2336,8 +2347,9 @@ public Builder clearClientCertificate() { * * *
-     * Optional. Defines a mechanism to provision client identity (public and private keys)
-     * for peer to peer authentication. The presence of this dictates mTLS.
+     * Optional. Defines a mechanism to provision client identity (public and
+     * private keys) for peer to peer authentication. The presence of this
+     * dictates mTLS.
      * 
* * @@ -2383,9 +2395,9 @@ private void ensureServerValidationCaIsMutable() { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2404,9 +2416,9 @@ private void ensureServerValidationCaIsMutable() { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2424,9 +2436,9 @@ public int getServerValidationCaCount() { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2444,9 +2456,9 @@ public com.google.cloud.networksecurity.v1beta1.ValidationCA getServerValidation * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2471,9 +2483,9 @@ public Builder setServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2495,9 +2507,9 @@ public Builder setServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2522,9 +2534,9 @@ public Builder addServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2549,9 +2561,9 @@ public Builder addServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2573,9 +2585,9 @@ public Builder addServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2597,9 +2609,9 @@ public Builder addServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2622,9 +2634,9 @@ public Builder addAllServerValidationCa( * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2645,9 +2657,9 @@ public Builder clearServerValidationCa() { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2668,9 +2680,9 @@ public Builder removeServerValidationCa(int index) { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2685,9 +2697,9 @@ public Builder removeServerValidationCa(int index) { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2706,9 +2718,9 @@ public Builder removeServerValidationCa(int index) { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2727,9 +2739,9 @@ public Builder removeServerValidationCa(int index) { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2745,9 +2757,9 @@ public Builder removeServerValidationCa(int index) { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * @@ -2764,9 +2776,9 @@ public Builder removeServerValidationCa(int index) { * * *
-     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-     * validate the server certificate. If empty, client does not validate the
-     * server certificate.
+     * Optional. Defines the mechanism to obtain the Certificate Authority
+     * certificate to validate the server certificate. If empty, client does not
+     * validate the server certificate.
      * 
* * diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyOrBuilder.java index c61b2e26..0e06dc59 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyOrBuilder.java @@ -241,8 +241,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines a mechanism to provision client identity (public and private keys)
-   * for peer to peer authentication. The presence of this dictates mTLS.
+   * Optional. Defines a mechanism to provision client identity (public and
+   * private keys) for peer to peer authentication. The presence of this
+   * dictates mTLS.
    * 
* * @@ -256,8 +257,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines a mechanism to provision client identity (public and private keys)
-   * for peer to peer authentication. The presence of this dictates mTLS.
+   * Optional. Defines a mechanism to provision client identity (public and
+   * private keys) for peer to peer authentication. The presence of this
+   * dictates mTLS.
    * 
* * @@ -271,8 +273,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines a mechanism to provision client identity (public and private keys)
-   * for peer to peer authentication. The presence of this dictates mTLS.
+   * Optional. Defines a mechanism to provision client identity (public and
+   * private keys) for peer to peer authentication. The presence of this
+   * dictates mTLS.
    * 
* * @@ -286,9 +289,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -300,9 +303,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -314,9 +317,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -328,9 +331,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * @@ -343,9 +346,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Optional. Defines the mechanism to obtain the Certificate Authority certificate to
-   * validate the server certificate. If empty, client does not validate the
-   * server certificate.
+   * Optional. Defines the mechanism to obtain the Certificate Authority
+   * certificate to validate the server certificate. If empty, client does not
+   * validate the server certificate.
    * 
* * diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyProto.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyProto.java index e6209856..141a069d 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyProto.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ClientTlsPolicyProto.java @@ -74,53 +74,52 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ehavior.proto\032\031google/api/resource.proto" + "\032.google/cloud/networksecurity/v1beta1/t" + "ls.proto\032 google/protobuf/field_mask.pro" - + "to\032\037google/protobuf/timestamp.proto\032\034goo" - + "gle/api/annotations.proto\"\373\004\n\017ClientTlsP" - + "olicy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013description\030" - + "\002 \001(\tB\003\340A\001\0224\n\013create_time\030\003 \001(\0132\032.google" - + ".protobuf.TimestampB\003\340A\003\0224\n\013update_time\030" - + "\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022V" - + "\n\006labels\030\005 \003(\0132A.google.cloud.networksec" - + "urity.v1beta1.ClientTlsPolicy.LabelsEntr" - + "yB\003\340A\001\022\020\n\003sni\030\006 \001(\tB\003\340A\001\022Z\n\022client_certi" - + "ficate\030\007 \001(\01329.google.cloud.networksecur" - + "ity.v1beta1.CertificateProviderB\003\340A\001\022U\n\024" - + "server_validation_ca\030\010 \003(\01322.google.clou" - + "d.networksecurity.v1beta1.ValidationCAB\003" - + "\340A\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001:\202\001\352A\177\n.networksecurity.google" - + "apis.com/ClientTlsPolicy\022Mprojects/{proj" - + "ect}/locations/{location}/clientTlsPolic" - + "ies/{client_tls_policy}\"\200\001\n\034ListClientTl" - + "sPoliciesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#" - + "\n!locations.googleapis.com/Location\022\021\n\tp" - + "age_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\214\001\n\035L" - + "istClientTlsPoliciesResponse\022R\n\023client_t" - + "ls_policies\030\001 \003(\01325.google.cloud.network" - + "security.v1beta1.ClientTlsPolicy\022\027\n\017next" - + "_page_token\030\002 \001(\t\"a\n\031GetClientTlsPolicyR" - + "equest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.networksec" - + "urity.googleapis.com/ClientTlsPolicy\"\340\001\n" - + "\034CreateClientTlsPolicyRequest\022F\n\006parent\030" - + "\001 \001(\tB6\340A\002\372A0\n.networksecurity.googleapi" - + "s.com/ClientTlsPolicy\022!\n\024client_tls_poli" - + "cy_id\030\002 \001(\tB\003\340A\002\022U\n\021client_tls_policy\030\003 " - + "\001(\01325.google.cloud.networksecurity.v1bet" - + "a1.ClientTlsPolicyB\003\340A\002\"\253\001\n\034UpdateClient" - + "TlsPolicyRequest\0224\n\013update_mask\030\001 \001(\0132\032." - + "google.protobuf.FieldMaskB\003\340A\001\022U\n\021client" - + "_tls_policy\030\002 \001(\01325.google.cloud.network" - + "security.v1beta1.ClientTlsPolicyB\003\340A\002\"d\n" - + "\034DeleteClientTlsPolicyRequest\022D\n\004name\030\001 " - + "\001(\tB6\340A\002\372A0\n.networksecurity.googleapis." - + "com/ClientTlsPolicyB\217\002\n(com.google.cloud" - + ".networksecurity.v1beta1B\024ClientTlsPolic" - + "yProtoP\001ZSgoogle.golang.org/genproto/goo" - + "gleapis/cloud/networksecurity/v1beta1;ne" - + "tworksecurity\252\002$Google.Cloud.NetworkSecu" - + "rity.V1Beta1\312\002$Google\\Cloud\\NetworkSecur" - + "ity\\V1beta1\352\002\'Google::Cloud::NetworkSecu" - + "rity::V1beta1b\006proto3" + + "to\032\037google/protobuf/timestamp.proto\"\373\004\n\017" + + "ClientTlsPolicy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013de" + + "scription\030\002 \001(\tB\003\340A\001\0224\n\013create_time\030\003 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013up" + + "date_time\030\004 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\022V\n\006labels\030\005 \003(\0132A.google.cloud." + + "networksecurity.v1beta1.ClientTlsPolicy." + + "LabelsEntryB\003\340A\001\022\020\n\003sni\030\006 \001(\tB\003\340A\001\022Z\n\022cl" + + "ient_certificate\030\007 \001(\01329.google.cloud.ne" + + "tworksecurity.v1beta1.CertificateProvide" + + "rB\003\340A\001\022U\n\024server_validation_ca\030\010 \003(\01322.g" + + "oogle.cloud.networksecurity.v1beta1.Vali" + + "dationCAB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001:\202\001\352A\177\n.networksecur" + + "ity.googleapis.com/ClientTlsPolicy\022Mproj" + + "ects/{project}/locations/{location}/clie" + + "ntTlsPolicies/{client_tls_policy}\"\200\001\n\034Li" + + "stClientTlsPoliciesRequest\0229\n\006parent\030\001 \001" + + "(\tB)\340A\002\372A#\n!locations.googleapis.com/Loc" + + "ation\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\"\214\001\n\035ListClientTlsPoliciesResponse\022R" + + "\n\023client_tls_policies\030\001 \003(\01325.google.clo" + + "ud.networksecurity.v1beta1.ClientTlsPoli" + + "cy\022\027\n\017next_page_token\030\002 \001(\t\"a\n\031GetClient" + + "TlsPolicyRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n." + + "networksecurity.googleapis.com/ClientTls" + + "Policy\"\340\001\n\034CreateClientTlsPolicyRequest\022" + + "F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.networksecurity" + + ".googleapis.com/ClientTlsPolicy\022!\n\024clien" + + "t_tls_policy_id\030\002 \001(\tB\003\340A\002\022U\n\021client_tls" + + "_policy\030\003 \001(\01325.google.cloud.networksecu" + + "rity.v1beta1.ClientTlsPolicyB\003\340A\002\"\253\001\n\034Up" + + "dateClientTlsPolicyRequest\0224\n\013update_mas" + + "k\030\001 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001" + + "\022U\n\021client_tls_policy\030\002 \001(\01325.google.clo" + + "ud.networksecurity.v1beta1.ClientTlsPoli" + + "cyB\003\340A\002\"d\n\034DeleteClientTlsPolicyRequest\022" + + "D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.networksecurity.g" + + "oogleapis.com/ClientTlsPolicyB\217\002\n(com.go" + + "ogle.cloud.networksecurity.v1beta1B\024Clie" + + "ntTlsPolicyProtoP\001ZSgoogle.golang.org/ge" + + "nproto/googleapis/cloud/networksecurity/" + + "v1beta1;networksecurity\252\002$Google.Cloud.N" + + "etworkSecurity.V1Beta1\312\002$Google\\Cloud\\Ne" + + "tworkSecurity\\V1beta1\352\002\'Google::Cloud::N" + + "etworkSecurity::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -131,7 +130,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.networksecurity.v1beta1.TlsProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_networksecurity_v1beta1_ClientTlsPolicy_descriptor = getDescriptor().getMessageTypes().get(0); @@ -218,7 +216,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.networksecurity.v1beta1.TlsProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CommonProto.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CommonProto.java index 0cb4fe04..df2e3c8d 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CommonProto.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CommonProto.java @@ -43,21 +43,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n1google/cloud/networksecurity/v1beta1/c" + "ommon.proto\022$google.cloud.networksecurit" + "y.v1beta1\032\037google/api/field_behavior.pro" - + "to\032\037google/protobuf/timestamp.proto\032\034goo" - + "gle/api/annotations.proto\"\200\002\n\021OperationM" - + "etadata\0224\n\013create_time\030\001 \001(\0132\032.google.pr" - + "otobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132" - + "\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006targ" - + "et\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016stat" - + "us_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_cance" - + "llation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB" - + "\003\340A\003B\206\002\n(com.google.cloud.networksecurit" - + "y.v1beta1B\013CommonProtoP\001ZSgoogle.golang." - + "org/genproto/googleapis/cloud/networksec" - + "urity/v1beta1;networksecurity\252\002$Google.C" - + "loud.NetworkSecurity.V1Beta1\312\002$Google\\Cl" - + "oud\\NetworkSecurity\\V1beta1\352\002\'Google::Cl" - + "oud::NetworkSecurity::V1beta1b\006proto3" + + "to\032\037google/protobuf/timestamp.proto\"\200\002\n\021" + + "OperationMetadata\0224\n\013create_time\030\001 \001(\0132\032" + + ".google.protobuf.TimestampB\003\340A\003\0221\n\010end_t" + + "ime\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340" + + "A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026reque" + + "sted_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_vers" + + "ion\030\007 \001(\tB\003\340A\003B\206\002\n(com.google.cloud.netw" + + "orksecurity.v1beta1B\013CommonProtoP\001ZSgoog" + + "le.golang.org/genproto/googleapis/cloud/" + + "networksecurity/v1beta1;networksecurity\252" + + "\002$Google.Cloud.NetworkSecurity.V1Beta1\312\002" + + "$Google\\Cloud\\NetworkSecurity\\V1beta1\352\002\'" + + "Google::Cloud::NetworkSecurity::V1beta1b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -65,7 +65,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_networksecurity_v1beta1_OperationMetadata_descriptor = getDescriptor().getMessageTypes().get(0); @@ -88,7 +87,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequest.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequest.java index cf4acdd4..4df049f8 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequest.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequest.java @@ -199,9 +199,10 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * Required. Short name of the ClientTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "client_mtls_policy".
    * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -224,9 +225,10 @@ public java.lang.String getClientTlsPolicyId() { * * *
-   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * Required. Short name of the ClientTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "client_mtls_policy".
    * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -798,9 +800,10 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * Required. Short name of the ClientTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "client_mtls_policy".
      * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -822,9 +825,10 @@ public java.lang.String getClientTlsPolicyId() { * * *
-     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * Required. Short name of the ClientTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "client_mtls_policy".
      * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -846,9 +850,10 @@ public com.google.protobuf.ByteString getClientTlsPolicyIdBytes() { * * *
-     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * Required. Short name of the ClientTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "client_mtls_policy".
      * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -869,9 +874,10 @@ public Builder setClientTlsPolicyId(java.lang.String value) { * * *
-     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * Required. Short name of the ClientTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "client_mtls_policy".
      * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -888,9 +894,10 @@ public Builder clearClientTlsPolicyId() { * * *
-     * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "client_mtls_policy".
+     * Required. Short name of the ClientTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "client_mtls_policy".
      * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequestOrBuilder.java index d7d98ce0..1a24cfe5 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequestOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateClientTlsPolicyRequestOrBuilder.java @@ -58,9 +58,10 @@ public interface CreateClientTlsPolicyRequestOrBuilder * * *
-   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * Required. Short name of the ClientTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "client_mtls_policy".
    * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -72,9 +73,10 @@ public interface CreateClientTlsPolicyRequestOrBuilder * * *
-   * Required. Short name of the ClientTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "client_mtls_policy".
+   * Required. Short name of the ClientTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "client_mtls_policy".
    * 
* * string client_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequest.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequest.java index 918f24c6..48bb547a 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequest.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequest.java @@ -199,9 +199,10 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * Required. Short name of the ServerTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "server_mtls_policy".
    * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -224,9 +225,10 @@ public java.lang.String getServerTlsPolicyId() { * * *
-   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * Required. Short name of the ServerTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "server_mtls_policy".
    * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -798,9 +800,10 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * Required. Short name of the ServerTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "server_mtls_policy".
      * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -822,9 +825,10 @@ public java.lang.String getServerTlsPolicyId() { * * *
-     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * Required. Short name of the ServerTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "server_mtls_policy".
      * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -846,9 +850,10 @@ public com.google.protobuf.ByteString getServerTlsPolicyIdBytes() { * * *
-     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * Required. Short name of the ServerTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "server_mtls_policy".
      * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -869,9 +874,10 @@ public Builder setServerTlsPolicyId(java.lang.String value) { * * *
-     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * Required. Short name of the ServerTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "server_mtls_policy".
      * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -888,9 +894,10 @@ public Builder clearServerTlsPolicyId() { * * *
-     * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-     * be 1-63 characters long, containing only letters, numbers, hyphens, and
-     * underscores, and should not start with a number. E.g. "server_mtls_policy".
+     * Required. Short name of the ServerTlsPolicy resource to be created. This
+     * value should be 1-63 characters long, containing only letters, numbers,
+     * hyphens, and underscores, and should not start with a number. E.g.
+     * "server_mtls_policy".
      * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequestOrBuilder.java index e78ad0b7..fcb0feb7 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequestOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/CreateServerTlsPolicyRequestOrBuilder.java @@ -58,9 +58,10 @@ public interface CreateServerTlsPolicyRequestOrBuilder * * *
-   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * Required. Short name of the ServerTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "server_mtls_policy".
    * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -72,9 +73,10 @@ public interface CreateServerTlsPolicyRequestOrBuilder * * *
-   * Required. Short name of the ServerTlsPolicy resource to be created. This value should
-   * be 1-63 characters long, containing only letters, numbers, hyphens, and
-   * underscores, and should not start with a number. E.g. "server_mtls_policy".
+   * Required. Short name of the ServerTlsPolicy resource to be created. This
+   * value should be 1-63 characters long, containing only letters, numbers,
+   * hyphens, and underscores, and should not start with a number. E.g.
+   * "server_mtls_policy".
    * 
* * string server_tls_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequest.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequest.java index 648e1841..38ef7e52 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequest.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequest.java @@ -121,8 +121,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the
+   * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
    * 
* * @@ -147,8 +147,8 @@ public java.lang.String getName() { * * *
-   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the
+   * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
    * 
* * @@ -508,8 +508,8 @@ public Builder mergeFrom( * * *
-     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the
+     * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      * 
* * @@ -533,8 +533,8 @@ public java.lang.String getName() { * * *
-     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the
+     * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      * 
* * @@ -558,8 +558,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the
+     * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      * 
* * @@ -582,8 +582,8 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the
+     * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      * 
* * @@ -602,8 +602,8 @@ public Builder clearName() { * * *
-     * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-     * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+     * Required. A name of the AuthorizationPolicy to delete. Must be in the
+     * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
      * 
* * diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequestOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequestOrBuilder.java index ca7a1977..da42b96c 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequestOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/DeleteAuthorizationPolicyRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface DeleteAuthorizationPolicyRequestOrBuilder * * *
-   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the
+   * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
    * 
* * @@ -42,8 +42,8 @@ public interface DeleteAuthorizationPolicyRequestOrBuilder * * *
-   * Required. A name of the AuthorizationPolicy to delete. Must be in the format
-   * `projects/{project}/locations/{location}/authorizationPolicies/*`.
+   * Required. A name of the AuthorizationPolicy to delete. Must be in the
+   * format `projects/{project}/locations/{location}/authorizationPolicies/*`.
    * 
* * diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpoint.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpoint.java index c8ee221a..dead5b04 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpoint.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpoint.java @@ -119,8 +119,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-   * should start with “unix:”.
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+   * and should start with "unix:".
    * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -143,8 +143,8 @@ public java.lang.String getTargetUri() { * * *
-   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-   * should start with “unix:”.
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+   * and should start with "unix:".
    * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -488,8 +488,8 @@ public Builder mergeFrom( * * *
-     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-     * should start with “unix:”.
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+     * and should start with "unix:".
      * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -511,8 +511,8 @@ public java.lang.String getTargetUri() { * * *
-     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-     * should start with “unix:”.
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+     * and should start with "unix:".
      * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -534,8 +534,8 @@ public com.google.protobuf.ByteString getTargetUriBytes() { * * *
-     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-     * should start with “unix:”.
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+     * and should start with "unix:".
      * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -556,8 +556,8 @@ public Builder setTargetUri(java.lang.String value) { * * *
-     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-     * should start with “unix:”.
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+     * and should start with "unix:".
      * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -574,8 +574,8 @@ public Builder clearTargetUri() { * * *
-     * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-     * should start with “unix:”.
+     * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+     * and should start with "unix:".
      * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpointOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpointOrBuilder.java index e90cc417..dad56dfa 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpointOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/GrpcEndpointOrBuilder.java @@ -27,8 +27,8 @@ public interface GrpcEndpointOrBuilder * * *
-   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-   * should start with “unix:”.
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+   * and should start with "unix:".
    * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -40,8 +40,8 @@ public interface GrpcEndpointOrBuilder * * *
-   * Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
-   * should start with “unix:”.
+   * Required. The target URI of the gRPC endpoint. Only UDS path is supported,
+   * and should start with "unix:".
    * 
* * string target_uri = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadata.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadata.java index 2b549789..8e4c09be 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadata.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadata.java @@ -425,8 +425,9 @@ public com.google.protobuf.ByteString getStatusMessageBytes() { *
    * Output only. Identifies whether the user has requested cancellation
    * of the operation. Operations that have successfully been cancelled
-   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
-   * corresponding to `Code.CANCELLED`.
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
    * 
* * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1639,8 +1640,9 @@ public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { *
      * Output only. Identifies whether the user has requested cancellation
      * of the operation. Operations that have successfully been cancelled
-     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
-     * corresponding to `Code.CANCELLED`.
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
      * 
* * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1657,8 +1659,9 @@ public boolean getRequestedCancellation() { *
      * Output only. Identifies whether the user has requested cancellation
      * of the operation. Operations that have successfully been cancelled
-     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
-     * corresponding to `Code.CANCELLED`.
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
      * 
* * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1678,8 +1681,9 @@ public Builder setRequestedCancellation(boolean value) { *
      * Output only. Identifies whether the user has requested cancellation
      * of the operation. Operations that have successfully been cancelled
-     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
-     * corresponding to `Code.CANCELLED`.
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
      * 
* * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadataOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadataOrBuilder.java index 3f97707f..9cba9e01 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadataOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/OperationMetadataOrBuilder.java @@ -180,8 +180,9 @@ public interface OperationMetadataOrBuilder *
    * Output only. Identifies whether the user has requested cancellation
    * of the operation. Operations that have successfully been cancelled
-   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
-   * corresponding to `Code.CANCELLED`.
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
    * 
* * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicy.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicy.java index 9aba06b8..f181745d 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicy.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicy.java @@ -1618,6 +1618,8 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { * and `mtls_policy` are set, server allows both plain text and mTLS * connections. See documentation of other encryption modes to confirm * compatibility. + * Consider using it if you wish to upgrade in place your deployment to TLS + * while having mixed TLS and non-TLS traffic reaching port :80. * * * bool allow_open = 6; @@ -3041,6 +3043,8 @@ public Builder putAllLabels(java.util.Map va * and `mtls_policy` are set, server allows both plain text and mTLS * connections. See documentation of other encryption modes to confirm * compatibility. + * Consider using it if you wish to upgrade in place your deployment to TLS + * while having mixed TLS and non-TLS traffic reaching port :80. * * * bool allow_open = 6; @@ -3061,6 +3065,8 @@ public boolean getAllowOpen() { * and `mtls_policy` are set, server allows both plain text and mTLS * connections. See documentation of other encryption modes to confirm * compatibility. + * Consider using it if you wish to upgrade in place your deployment to TLS + * while having mixed TLS and non-TLS traffic reaching port :80. * * * bool allow_open = 6; @@ -3084,6 +3090,8 @@ public Builder setAllowOpen(boolean value) { * and `mtls_policy` are set, server allows both plain text and mTLS * connections. See documentation of other encryption modes to confirm * compatibility. + * Consider using it if you wish to upgrade in place your deployment to TLS + * while having mixed TLS and non-TLS traffic reaching port :80. * * * bool allow_open = 6; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyOrBuilder.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyOrBuilder.java index fb4dbe6f..67eb3c43 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyOrBuilder.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyOrBuilder.java @@ -220,6 +220,8 @@ java.lang.String getLabelsOrDefault( * and `mtls_policy` are set, server allows both plain text and mTLS * connections. See documentation of other encryption modes to confirm * compatibility. + * Consider using it if you wish to upgrade in place your deployment to TLS + * while having mixed TLS and non-TLS traffic reaching port :80. * * * bool allow_open = 6; diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyProto.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyProto.java index e7323b8a..6f2b7d33 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyProto.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/ServerTlsPolicyProto.java @@ -78,55 +78,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ehavior.proto\032\031google/api/resource.proto" + "\032.google/cloud/networksecurity/v1beta1/t" + "ls.proto\032 google/protobuf/field_mask.pro" - + "to\032\037google/protobuf/timestamp.proto\032\034goo" - + "gle/api/annotations.proto\"\316\005\n\017ServerTlsP" - + "olicy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\023\n\013description\030" - + "\002 \001(\t\0224\n\013create_time\030\003 \001(\0132\032.google.prot" - + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\004 \001(\013" - + "2\032.google.protobuf.TimestampB\003\340A\003\022Q\n\006lab" - + "els\030\005 \003(\0132A.google.cloud.networksecurity" - + ".v1beta1.ServerTlsPolicy.LabelsEntry\022\022\n\n" - + "allow_open\030\006 \001(\010\022U\n\022server_certificate\030\007" - + " \001(\01329.google.cloud.networksecurity.v1be" - + "ta1.CertificateProvider\022U\n\013mtls_policy\030\010" - + " \001(\0132@.google.cloud.networksecurity.v1be" - + "ta1.ServerTlsPolicy.MTLSPolicy\032^\n\nMTLSPo" - + "licy\022P\n\024client_validation_ca\030\001 \003(\01322.goo" - + "gle.cloud.networksecurity.v1beta1.Valida" - + "tionCA\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" - + "lue\030\002 \001(\t:\0028\001:\202\001\352A\177\n.networksecurity.goo" - + "gleapis.com/ServerTlsPolicy\022Mprojects/{p" - + "roject}/locations/{location}/serverTlsPo" - + "licies/{server_tls_policy}\"\200\001\n\034ListServe" - + "rTlsPoliciesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002" - + "\372A#\n!locations.googleapis.com/Location\022\021" - + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\214\001" - + "\n\035ListServerTlsPoliciesResponse\022R\n\023serve" - + "r_tls_policies\030\001 \003(\01325.google.cloud.netw" - + "orksecurity.v1beta1.ServerTlsPolicy\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\"a\n\031GetServerTlsPoli" - + "cyRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.network" - + "security.googleapis.com/ServerTlsPolicy\"" - + "\340\001\n\034CreateServerTlsPolicyRequest\022F\n\006pare" - + "nt\030\001 \001(\tB6\340A\002\372A0\n.networksecurity.google" - + "apis.com/ServerTlsPolicy\022!\n\024server_tls_p" - + "olicy_id\030\002 \001(\tB\003\340A\002\022U\n\021server_tls_policy" - + "\030\003 \001(\01325.google.cloud.networksecurity.v1" - + "beta1.ServerTlsPolicyB\003\340A\002\"\253\001\n\034UpdateSer" - + "verTlsPolicyRequest\0224\n\013update_mask\030\001 \001(\013" - + "2\032.google.protobuf.FieldMaskB\003\340A\001\022U\n\021ser" - + "ver_tls_policy\030\002 \001(\01325.google.cloud.netw" - + "orksecurity.v1beta1.ServerTlsPolicyB\003\340A\002" - + "\"d\n\034DeleteServerTlsPolicyRequest\022D\n\004name" - + "\030\001 \001(\tB6\340A\002\372A0\n.networksecurity.googleap" - + "is.com/ServerTlsPolicyB\217\002\n(com.google.cl" - + "oud.networksecurity.v1beta1B\024ServerTlsPo" - + "licyProtoP\001ZSgoogle.golang.org/genproto/" - + "googleapis/cloud/networksecurity/v1beta1" - + ";networksecurity\252\002$Google.Cloud.NetworkS" - + "ecurity.V1Beta1\312\002$Google\\Cloud\\NetworkSe" - + "curity\\V1beta1\352\002\'Google::Cloud::NetworkS" - + "ecurity::V1beta1b\006proto3" + + "to\032\037google/protobuf/timestamp.proto\"\316\005\n\017" + + "ServerTlsPolicy\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\023\n\013de" + + "scription\030\002 \001(\t\0224\n\013create_time\030\003 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\0224\n\013update_" + + "time\030\004 \001(\0132\032.google.protobuf.TimestampB\003" + + "\340A\003\022Q\n\006labels\030\005 \003(\0132A.google.cloud.netwo" + + "rksecurity.v1beta1.ServerTlsPolicy.Label" + + "sEntry\022\022\n\nallow_open\030\006 \001(\010\022U\n\022server_cer" + + "tificate\030\007 \001(\01329.google.cloud.networksec" + + "urity.v1beta1.CertificateProvider\022U\n\013mtl" + + "s_policy\030\010 \001(\0132@.google.cloud.networksec" + + "urity.v1beta1.ServerTlsPolicy.MTLSPolicy" + + "\032^\n\nMTLSPolicy\022P\n\024client_validation_ca\030\001" + + " \003(\01322.google.cloud.networksecurity.v1be" + + "ta1.ValidationCA\032-\n\013LabelsEntry\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\202\001\352A\177\n.networkse" + + "curity.googleapis.com/ServerTlsPolicy\022Mp" + + "rojects/{project}/locations/{location}/s" + + "erverTlsPolicies/{server_tls_policy}\"\200\001\n" + + "\034ListServerTlsPoliciesRequest\0229\n\006parent\030" + + "\001 \001(\tB)\340A\002\372A#\n!locations.googleapis.com/" + + "Location\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" + + "n\030\003 \001(\t\"\214\001\n\035ListServerTlsPoliciesRespons" + + "e\022R\n\023server_tls_policies\030\001 \003(\01325.google." + + "cloud.networksecurity.v1beta1.ServerTlsP" + + "olicy\022\027\n\017next_page_token\030\002 \001(\t\"a\n\031GetSer" + + "verTlsPolicyRequest\022D\n\004name\030\001 \001(\tB6\340A\002\372A" + + "0\n.networksecurity.googleapis.com/Server" + + "TlsPolicy\"\340\001\n\034CreateServerTlsPolicyReque" + + "st\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.networksecur" + + "ity.googleapis.com/ServerTlsPolicy\022!\n\024se" + + "rver_tls_policy_id\030\002 \001(\tB\003\340A\002\022U\n\021server_" + + "tls_policy\030\003 \001(\01325.google.cloud.networks" + + "ecurity.v1beta1.ServerTlsPolicyB\003\340A\002\"\253\001\n" + + "\034UpdateServerTlsPolicyRequest\0224\n\013update_" + + "mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB\003" + + "\340A\001\022U\n\021server_tls_policy\030\002 \001(\01325.google." + + "cloud.networksecurity.v1beta1.ServerTlsP" + + "olicyB\003\340A\002\"d\n\034DeleteServerTlsPolicyReque" + + "st\022D\n\004name\030\001 \001(\tB6\340A\002\372A0\n.networksecurit" + + "y.googleapis.com/ServerTlsPolicyB\217\002\n(com" + + ".google.cloud.networksecurity.v1beta1B\024S" + + "erverTlsPolicyProtoP\001ZSgoogle.golang.org" + + "/genproto/googleapis/cloud/networksecuri" + + "ty/v1beta1;networksecurity\252\002$Google.Clou" + + "d.NetworkSecurity.V1Beta1\312\002$Google\\Cloud" + + "\\NetworkSecurity\\V1beta1\352\002\'Google::Cloud" + + "::NetworkSecurity::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -137,7 +136,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.networksecurity.v1beta1.TlsProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_networksecurity_v1beta1_ServerTlsPolicy_descriptor = getDescriptor().getMessageTypes().get(0); @@ -234,7 +232,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.networksecurity.v1beta1.TlsProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/TlsProto.java b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/TlsProto.java index e0289e81..8581da04 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/TlsProto.java +++ b/proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/TlsProto.java @@ -54,35 +54,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n.google/cloud/networksecurity/v1beta1/t" + "ls.proto\022$google.cloud.networksecurity.v" - + "1beta1\032\037google/api/field_behavior.proto\032" - + "\034google/api/annotations.proto\"\'\n\014GrpcEnd" - + "point\022\027\n\ntarget_uri\030\001 \001(\tB\003\340A\002\"\317\001\n\014Valid" - + "ationCA\022K\n\rgrpc_endpoint\030\002 \001(\01322.google." - + "cloud.networksecurity.v1beta1.GrpcEndpoi" - + "ntH\000\022j\n\035certificate_provider_instance\030\003 " - + "\001(\0132A.google.cloud.networksecurity.v1bet" - + "a1.CertificateProviderInstanceH\000B\006\n\004type" - + "\";\n\033CertificateProviderInstance\022\034\n\017plugi" - + "n_instance\030\001 \001(\tB\003\340A\002\"\326\001\n\023CertificatePro" - + "vider\022K\n\rgrpc_endpoint\030\002 \001(\01322.google.cl" - + "oud.networksecurity.v1beta1.GrpcEndpoint" - + "H\000\022j\n\035certificate_provider_instance\030\003 \001(" - + "\0132A.google.cloud.networksecurity.v1beta1" - + ".CertificateProviderInstanceH\000B\006\n\004typeB\203" - + "\002\n(com.google.cloud.networksecurity.v1be" - + "ta1B\010TlsProtoP\001ZSgoogle.golang.org/genpr" - + "oto/googleapis/cloud/networksecurity/v1b" - + "eta1;networksecurity\252\002$Google.Cloud.Netw" - + "orkSecurity.V1Beta1\312\002$Google\\Cloud\\Netwo" - + "rkSecurity\\V1beta1\352\002\'Google::Cloud::Netw" - + "orkSecurity::V1beta1b\006proto3" + + "1beta1\032\037google/api/field_behavior.proto\"" + + "\'\n\014GrpcEndpoint\022\027\n\ntarget_uri\030\001 \001(\tB\003\340A\002" + + "\"\317\001\n\014ValidationCA\022K\n\rgrpc_endpoint\030\002 \001(\013" + + "22.google.cloud.networksecurity.v1beta1." + + "GrpcEndpointH\000\022j\n\035certificate_provider_i" + + "nstance\030\003 \001(\0132A.google.cloud.networksecu" + + "rity.v1beta1.CertificateProviderInstance" + + "H\000B\006\n\004type\";\n\033CertificateProviderInstanc" + + "e\022\034\n\017plugin_instance\030\001 \001(\tB\003\340A\002\"\326\001\n\023Cert" + + "ificateProvider\022K\n\rgrpc_endpoint\030\002 \001(\01322" + + ".google.cloud.networksecurity.v1beta1.Gr" + + "pcEndpointH\000\022j\n\035certificate_provider_ins" + + "tance\030\003 \001(\0132A.google.cloud.networksecuri" + + "ty.v1beta1.CertificateProviderInstanceH\000" + + "B\006\n\004typeB\203\002\n(com.google.cloud.networksec" + + "urity.v1beta1B\010TlsProtoP\001ZSgoogle.golang" + + ".org/genproto/googleapis/cloud/networkse" + + "curity/v1beta1;networksecurity\252\002$Google." + + "Cloud.NetworkSecurity.V1Beta1\312\002$Google\\C" + + "loud\\NetworkSecurity\\V1beta1\352\002\'Google::C" + + "loud::NetworkSecurity::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_networksecurity_v1beta1_GrpcEndpoint_descriptor = getDescriptor().getMessageTypes().get(0); @@ -122,7 +120,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/authorization_policy.proto b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/authorization_policy.proto index f14dedf6..afae9ba5 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/authorization_policy.proto +++ b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/authorization_policy.proto @@ -20,7 +20,6 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity"; @@ -44,25 +43,25 @@ message AuthorizationPolicy { message Rule { // Specification of traffic source attributes. message Source { - // Optional. List of peer identities to match for authorization. At least one - // principal should match. Each peer can be an exact match, or a prefix - // match (example, "namespace/*") or a suffix match (example, // - // */service-account") or a presence match "*". Authorization based on the - // principal name without certificate validation (configured by + // Optional. List of peer identities to match for authorization. At least + // one principal should match. Each peer can be an exact match, or a + // prefix match (example, "namespace/*") or a suffix match (example, + // "*/service-account") or a presence match "*". Authorization based on + // the principal name without certificate validation (configured by // ServerTlsPolicy resource) is considered insecure. repeated string principals = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. List of CIDR ranges to match based on source IP address. At least one - // IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., - // "1.2.3.0/24") are supported. Authorization based on source IP alone - // should be avoided. The IP addresses of any load balancers or proxies - // should be considered untrusted. + // Optional. List of CIDR ranges to match based on source IP address. At + // least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR + // (e.g., "1.2.3.0/24") are supported. Authorization based on source IP + // alone should be avoided. The IP addresses of any load balancers or + // proxies should be considered untrusted. repeated string ip_blocks = 2 [(google.api.field_behavior) = OPTIONAL]; } // Specification of traffic destination attributes. message Destination { - // Specification of HTTP header match atrributes. + // Specification of HTTP header match attributes. message HttpHeaderMatch { oneof type { // Required. The value of the header must match the regular expression @@ -82,39 +81,42 @@ message AuthorizationPolicy { string header_name = 1 [(google.api.field_behavior) = REQUIRED]; } - // Required. List of host names to match. Matched against the ":authority" header in - // http requests. At least one host should match. Each host can be an - // exact match, or a prefix match (example "mydomain.*") or a suffix - // match (example // *.myorg.com") or a presence(any) match "*". + // Required. List of host names to match. Matched against the ":authority" + // header in http requests. At least one host should match. Each host can + // be an exact match, or a prefix match (example "mydomain.*") or a suffix + // match (example "*.myorg.com") or a presence (any) match "*". repeated string hosts = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. List of destination ports to match. At least one port should match. + // Required. List of destination ports to match. At least one port should + // match. repeated uint32 ports = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. A list of HTTP methods to match. At least one method should // match. Should not be set for gRPC services. repeated string methods = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Match against key:value pair in http header. Provides a flexible match - // based on HTTP headers, for potentially advanced use cases. At least one - // header should match. Avoid using header matches to make authorization - // decisions unless there is a strong guarantee that requests arrive - // through a trusted client or proxy. - HttpHeaderMatch http_header_match = 5 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Match against key:value pair in http header. Provides a + // flexible match based on HTTP headers, for potentially advanced use + // cases. At least one header should match. Avoid using header matches to + // make authorization decisions unless there is a strong guarantee that + // requests arrive through a trusted client or proxy. + HttpHeaderMatch http_header_match = 5 + [(google.api.field_behavior) = OPTIONAL]; } - // Optional. List of attributes for the traffic source. All of the sources must match. - // A source is a match if both principals and ip_blocks match. If not set, - // the action specified in the 'action' field will be applied without any - // rule checks for the source. + // Optional. List of attributes for the traffic source. All of the sources + // must match. A source is a match if both principals and ip_blocks match. + // If not set, the action specified in the 'action' field will be applied + // without any rule checks for the source. repeated Source sources = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. List of attributes for the traffic destination. All of the destinations - // must match. A destination is a match if a request matches all the - // specified hosts, ports, methods and headers. If not set, the + // Optional. List of attributes for the traffic destination. All of the + // destinations must match. A destination is a match if a request matches + // all the specified hosts, ports, methods and headers. If not set, the // action specified in the 'action' field will be applied without any rule // checks for the destination. - repeated Destination destinations = 2 [(google.api.field_behavior) = OPTIONAL]; + repeated Destination destinations = 2 + [(google.api.field_behavior) = OPTIONAL]; } // Possible values that define what action to take. @@ -139,22 +141,26 @@ message AuthorizationPolicy { string description = 2 [(google.api.field_behavior) = OPTIONAL]; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. Set of label tags associated with the AuthorizationPolicy resource. + // Optional. Set of label tags associated with the AuthorizationPolicy + // resource. map labels = 5 [(google.api.field_behavior) = OPTIONAL]; // Required. The action to take when a rule match is found. Possible values // are "ALLOW" or "DENY". Action action = 6 [(google.api.field_behavior) = REQUIRED]; - // Optional. List of rules to match. Note that at least one of the rules must match in - // order for the action specified in the 'action' field to be taken. A rule is - // a match if there is a matching source and destination. If left blank, the - // action specified in the `action` field will be applied on every request. + // Optional. List of rules to match. Note that at least one of the rules must + // match in order for the action specified in the 'action' field to be taken. + // A rule is a match if there is a matching source and destination. If left + // blank, the action specified in the `action` field will be applied on every + // request. repeated Rule rules = 7 [(google.api.field_behavior) = OPTIONAL]; } @@ -210,7 +216,7 @@ message CreateAuthorizationPolicyRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "networksecurity.googleapis.com/AuthorizationPolicy" + child_type: "networksecurity.googleapis.com/AuthorizationPolicy" } ]; @@ -221,7 +227,8 @@ message CreateAuthorizationPolicyRequest { string authorization_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. AuthorizationPolicy resource to be created. - AuthorizationPolicy authorization_policy = 3 [(google.api.field_behavior) = REQUIRED]; + AuthorizationPolicy authorization_policy = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the UpdateAuthorizationPolicy method. @@ -231,16 +238,18 @@ message UpdateAuthorizationPolicyRequest { // The fields specified in the update_mask are relative to the resource, not // the full request. A field will be overwritten if it is in the mask. If the // user does not provide a mask then all fields will be overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated AuthorizationPolicy resource. - AuthorizationPolicy authorization_policy = 2 [(google.api.field_behavior) = REQUIRED]; + AuthorizationPolicy authorization_policy = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the DeleteAuthorizationPolicy method. message DeleteAuthorizationPolicyRequest { - // Required. A name of the AuthorizationPolicy to delete. Must be in the format - // `projects/{project}/locations/{location}/authorizationPolicies/*`. + // Required. A name of the AuthorizationPolicy to delete. Must be in the + // format `projects/{project}/locations/{location}/authorizationPolicies/*`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/client_tls_policy.proto b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/client_tls_policy.proto index 6cc0c228..8f10ad7f 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/client_tls_policy.proto +++ b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/client_tls_policy.proto @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/networksecurity/v1beta1/tls.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity"; @@ -48,10 +47,12 @@ message ClientTlsPolicy { string description = 2 [(google.api.field_behavior) = OPTIONAL]; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Set of label tags associated with the resource. map labels = 5 [(google.api.field_behavior) = OPTIONAL]; @@ -60,14 +61,17 @@ message ClientTlsPolicy { // handshake. E.g: "secure.example.com". string sni = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Defines a mechanism to provision client identity (public and private keys) - // for peer to peer authentication. The presence of this dictates mTLS. - CertificateProvider client_certificate = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines the mechanism to obtain the Certificate Authority certificate to - // validate the server certificate. If empty, client does not validate the - // server certificate. - repeated ValidationCA server_validation_ca = 8 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Defines a mechanism to provision client identity (public and + // private keys) for peer to peer authentication. The presence of this + // dictates mTLS. + CertificateProvider client_certificate = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the mechanism to obtain the Certificate Authority + // certificate to validate the server certificate. If empty, client does not + // validate the server certificate. + repeated ValidationCA server_validation_ca = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Request used by the ListClientTlsPolicies method. @@ -121,17 +125,19 @@ message CreateClientTlsPolicyRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "networksecurity.googleapis.com/ClientTlsPolicy" + child_type: "networksecurity.googleapis.com/ClientTlsPolicy" } ]; - // Required. Short name of the ClientTlsPolicy resource to be created. This value should - // be 1-63 characters long, containing only letters, numbers, hyphens, and - // underscores, and should not start with a number. E.g. "client_mtls_policy". + // Required. Short name of the ClientTlsPolicy resource to be created. This + // value should be 1-63 characters long, containing only letters, numbers, + // hyphens, and underscores, and should not start with a number. E.g. + // "client_mtls_policy". string client_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. ClientTlsPolicy resource to be created. - ClientTlsPolicy client_tls_policy = 3 [(google.api.field_behavior) = REQUIRED]; + ClientTlsPolicy client_tls_policy = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request used by UpdateClientTlsPolicy method. @@ -142,10 +148,12 @@ message UpdateClientTlsPolicyRequest { // the full request. A field will be overwritten if it is in the // mask. If the user does not provide a mask then all fields will be // overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated ClientTlsPolicy resource. - ClientTlsPolicy client_tls_policy = 2 [(google.api.field_behavior) = REQUIRED]; + ClientTlsPolicy client_tls_policy = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the DeleteClientTlsPolicy method. diff --git a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/common.proto b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/common.proto index 4a85f652..7aa715d5 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/common.proto +++ b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/common.proto @@ -18,7 +18,6 @@ package google.cloud.networksecurity.v1beta1; import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity"; @@ -31,10 +30,12 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1beta1"; // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -47,8 +48,9 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. diff --git a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/server_tls_policy.proto b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/server_tls_policy.proto index d3c52121..ce92cfce 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/server_tls_policy.proto +++ b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/server_tls_policy.proto @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/networksecurity/v1beta1/tls.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity"; @@ -34,7 +33,6 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1beta1"; // ServerTlsPolicy is a resource that specifies how a server should authenticate // incoming requests. This resource itself does not affect configuration unless // it is attached to a target https proxy or endpoint config selector resource. -// message ServerTlsPolicy { option (google.api.resource) = { type: "networksecurity.googleapis.com/ServerTlsPolicy" @@ -57,10 +55,12 @@ message ServerTlsPolicy { string description = 2; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Set of label tags associated with the resource. map labels = 5; @@ -72,6 +72,9 @@ message ServerTlsPolicy { // and `mtls_policy` are set, server allows both plain text and mTLS // connections. See documentation of other encryption modes to confirm // compatibility. + // + // Consider using it if you wish to upgrade in place your deployment to TLS + // while having mixed TLS and non-TLS traffic reaching port :80. bool allow_open = 6; // @@ -140,17 +143,19 @@ message CreateServerTlsPolicyRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "networksecurity.googleapis.com/ServerTlsPolicy" + child_type: "networksecurity.googleapis.com/ServerTlsPolicy" } ]; - // Required. Short name of the ServerTlsPolicy resource to be created. This value should - // be 1-63 characters long, containing only letters, numbers, hyphens, and - // underscores, and should not start with a number. E.g. "server_mtls_policy". + // Required. Short name of the ServerTlsPolicy resource to be created. This + // value should be 1-63 characters long, containing only letters, numbers, + // hyphens, and underscores, and should not start with a number. E.g. + // "server_mtls_policy". string server_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. ServerTlsPolicy resource to be created. - ServerTlsPolicy server_tls_policy = 3 [(google.api.field_behavior) = REQUIRED]; + ServerTlsPolicy server_tls_policy = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request used by UpdateServerTlsPolicy method. @@ -161,10 +166,12 @@ message UpdateServerTlsPolicyRequest { // the full request. A field will be overwritten if it is in the // mask. If the user does not provide a mask then all fields will be // overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated ServerTlsPolicy resource. - ServerTlsPolicy server_tls_policy = 2 [(google.api.field_behavior) = REQUIRED]; + ServerTlsPolicy server_tls_policy = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the DeleteServerTlsPolicy method. diff --git a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/tls.proto b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/tls.proto index 740c785c..3addee9f 100644 --- a/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/tls.proto +++ b/proto-google-cloud-network-security-v1beta1/src/main/proto/google/cloud/networksecurity/v1beta1/tls.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.networksecurity.v1beta1; import "google/api/field_behavior.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity"; @@ -29,8 +28,8 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1beta1"; // Specification of the GRPC Endpoint. message GrpcEndpoint { - // Required. The target URI of the gRPC endpoint. Only UDS path is supported, and - // should start with “unix:”. + // Required. The target URI of the gRPC endpoint. Only UDS path is supported, + // and should start with "unix:". string target_uri = 1 [(google.api.field_behavior) = REQUIRED]; } @@ -55,9 +54,9 @@ message ValidationCA { // and configured by specifying this message. Workloads use the values from this // message to locate and load the CertificateProvider instance configuration. message CertificateProviderInstance { - // Required. Plugin instance name, used to locate and load CertificateProvider instance - // configuration. Set to "google_cloud_private_spiffe" to use Certificate - // Authority Service certificate provider instance. + // Required. Plugin instance name, used to locate and load CertificateProvider + // instance configuration. Set to "google_cloud_private_spiffe" to use + // Certificate Authority Service certificate provider instance. string plugin_instance = 1 [(google.api.field_behavior) = REQUIRED]; } diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000..6b436f37 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_create_setcredentialsprovider1_sync] +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.cloud.networksecurity.v1beta1.NetworkSecuritySettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + NetworkSecuritySettings networkSecuritySettings = + NetworkSecuritySettings.newBuilder() + .setTransportChannelProvider( + NetworkSecuritySettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + NetworkSecurityClient networkSecurityClient = + NetworkSecurityClient.create(networkSecuritySettings); + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java index 491de0b9..21139726 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicy.java @@ -19,8 +19,8 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_async] import com.google.api.core.ApiFuture; import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; -import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.longrunning.Operation; @@ -36,9 +36,7 @@ public static void asyncCreateAuthorizationPolicy() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthorizationPolicyRequest request = CreateAuthorizationPolicyRequest.newBuilder() - .setParent( - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthorizationPolicyId("authorizationPolicyId1314252166") .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java index 68a87363..7c00d5e8 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/AsyncCreateAuthorizationPolicyLRO.java @@ -19,8 +19,8 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_lro_async] import com.google.api.gax.longrunning.OperationFuture; import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; -import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.OperationMetadata; @@ -36,9 +36,7 @@ public static void asyncCreateAuthorizationPolicyLRO() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthorizationPolicyRequest request = CreateAuthorizationPolicyRequest.newBuilder() - .setParent( - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthorizationPolicyId("authorizationPolicyId1314252166") .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java index d1c6244f..828f3195 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicy.java @@ -18,8 +18,8 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_sync] import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; -import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; import com.google.cloud.networksecurity.v1beta1.CreateAuthorizationPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; public class SyncCreateAuthorizationPolicy { @@ -34,9 +34,7 @@ public static void syncCreateAuthorizationPolicy() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateAuthorizationPolicyRequest request = CreateAuthorizationPolicyRequest.newBuilder() - .setParent( - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAuthorizationPolicyId("authorizationPolicyId1314252166") .setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString.java similarity index 71% rename from samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java rename to samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString.java index e6bacdff..d70559ae 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString.java @@ -16,24 +16,23 @@ package com.google.cloud.networksecurity.v1beta1.samples; -// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_authorizationpolicynameauthorizationpolicystring_sync] +// [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_locationnameauthorizationpolicystring_sync] import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; -import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; -public class SyncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString { +public class SyncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString { public static void main(String[] args) throws Exception { - syncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString(); + syncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString(); } - public static void syncCreateAuthorizationPolicyAuthorizationpolicynameAuthorizationpolicyString() + public static void syncCreateAuthorizationPolicyLocationnameAuthorizationpolicyString() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - AuthorizationPolicyName parent = - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); String authorizationPolicyId = "authorizationPolicyId1314252166"; AuthorizationPolicy response = @@ -43,4 +42,4 @@ public static void syncCreateAuthorizationPolicyAuthorizationpolicynameAuthoriza } } } -// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_authorizationpolicynameauthorizationpolicystring_sync] +// [END networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_locationnameauthorizationpolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java index 9a6ac78c..41d7ce7b 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createauthorizationpolicy/SyncCreateAuthorizationPolicyStringAuthorizationpolicyString.java @@ -18,7 +18,7 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createauthorizationpolicy_stringauthorizationpolicystring_sync] import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicy; -import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; public class SyncCreateAuthorizationPolicyStringAuthorizationpolicyString { @@ -32,9 +32,7 @@ public static void syncCreateAuthorizationPolicyStringAuthorizationpolicyString( // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - String parent = - AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") - .toString(); + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); AuthorizationPolicy authorizationPolicy = AuthorizationPolicy.newBuilder().build(); String authorizationPolicyId = "authorizationPolicyId1314252166"; AuthorizationPolicy response = diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java index a48741df..00cc0937 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicy.java @@ -19,8 +19,8 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_async] import com.google.api.core.ApiFuture; import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.longrunning.Operation; @@ -36,9 +36,7 @@ public static void asyncCreateClientTlsPolicy() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() - .setParent( - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClientTlsPolicyId("clientTlsPolicyId-188933315") .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java index 69b8176c..b424c0ab 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/AsyncCreateClientTlsPolicyLRO.java @@ -19,8 +19,8 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_lro_async] import com.google.api.gax.longrunning.OperationFuture; import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.OperationMetadata; @@ -36,9 +36,7 @@ public static void asyncCreateClientTlsPolicyLRO() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() - .setParent( - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClientTlsPolicyId("clientTlsPolicyId-188933315") .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java index 21e917d1..8bde4306 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicy.java @@ -18,8 +18,8 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_sync] import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; import com.google.cloud.networksecurity.v1beta1.CreateClientTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; public class SyncCreateClientTlsPolicy { @@ -34,9 +34,7 @@ public static void syncCreateClientTlsPolicy() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateClientTlsPolicyRequest request = CreateClientTlsPolicyRequest.newBuilder() - .setParent( - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClientTlsPolicyId("clientTlsPolicyId-188933315") .setClientTlsPolicy(ClientTlsPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyLocationnameClienttlspolicyString.java similarity index 72% rename from samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java rename to samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyLocationnameClienttlspolicyString.java index eb78ff27..64e8a29c 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyLocationnameClienttlspolicyString.java @@ -16,24 +16,22 @@ package com.google.cloud.networksecurity.v1beta1.samples; -// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_clienttlspolicynameclienttlspolicystring_sync] +// [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_locationnameclienttlspolicystring_sync] import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; -public class SyncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString { +public class SyncCreateClientTlsPolicyLocationnameClienttlspolicyString { public static void main(String[] args) throws Exception { - syncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString(); + syncCreateClientTlsPolicyLocationnameClienttlspolicyString(); } - public static void syncCreateClientTlsPolicyClienttlspolicynameClienttlspolicyString() - throws Exception { + public static void syncCreateClientTlsPolicyLocationnameClienttlspolicyString() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - ClientTlsPolicyName parent = - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); String clientTlsPolicyId = "clientTlsPolicyId-188933315"; ClientTlsPolicy response = @@ -43,4 +41,4 @@ public static void syncCreateClientTlsPolicyClienttlspolicynameClienttlspolicySt } } } -// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_clienttlspolicynameclienttlspolicystring_sync] +// [END networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_locationnameclienttlspolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java index ba6aa2b9..2cd2a43f 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createclienttlspolicy/SyncCreateClientTlsPolicyStringClienttlspolicyString.java @@ -18,7 +18,7 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createclienttlspolicy_stringclienttlspolicystring_sync] import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ClientTlsPolicyName; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; public class SyncCreateClientTlsPolicyStringClienttlspolicyString { @@ -31,8 +31,7 @@ public static void syncCreateClientTlsPolicyStringClienttlspolicyString() throws // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - String parent = - ClientTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[CLIENT_TLS_POLICY]").toString(); + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ClientTlsPolicy clientTlsPolicy = ClientTlsPolicy.newBuilder().build(); String clientTlsPolicyId = "clientTlsPolicyId-188933315"; ClientTlsPolicy response = diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java index 50130540..0dafd358 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicy.java @@ -19,9 +19,9 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_async] import com.google.api.core.ApiFuture; import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; import com.google.longrunning.Operation; public class AsyncCreateServerTlsPolicy { @@ -36,9 +36,7 @@ public static void asyncCreateServerTlsPolicy() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() - .setParent( - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServerTlsPolicyId("serverTlsPolicyId-1966046011") .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java index 1c96d17b..81f6283f 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/AsyncCreateServerTlsPolicyLRO.java @@ -19,10 +19,10 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_lro_async] import com.google.api.gax.longrunning.OperationFuture; import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.OperationMetadata; import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; public class AsyncCreateServerTlsPolicyLRO { @@ -36,9 +36,7 @@ public static void asyncCreateServerTlsPolicyLRO() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() - .setParent( - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServerTlsPolicyId("serverTlsPolicyId-1966046011") .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java index 5aada445..abfa3359 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicy.java @@ -18,9 +18,9 @@ // [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_sync] import com.google.cloud.networksecurity.v1beta1.CreateServerTlsPolicyRequest; +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; public class SyncCreateServerTlsPolicy { @@ -34,9 +34,7 @@ public static void syncCreateServerTlsPolicy() throws Exception { try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { CreateServerTlsPolicyRequest request = CreateServerTlsPolicyRequest.newBuilder() - .setParent( - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]") - .toString()) + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServerTlsPolicyId("serverTlsPolicyId-1966046011") .setServerTlsPolicy(ServerTlsPolicy.newBuilder().build()) .build(); diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyLocationnameServertlspolicyString.java similarity index 72% rename from samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java rename to samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyLocationnameServertlspolicyString.java index f84fd060..99011883 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyLocationnameServertlspolicyString.java @@ -16,24 +16,22 @@ package com.google.cloud.networksecurity.v1beta1.samples; -// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_servertlspolicynameservertlspolicystring_sync] +// [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_locationnameservertlspolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; -public class SyncCreateServerTlsPolicyServertlspolicynameServertlspolicyString { +public class SyncCreateServerTlsPolicyLocationnameServertlspolicyString { public static void main(String[] args) throws Exception { - syncCreateServerTlsPolicyServertlspolicynameServertlspolicyString(); + syncCreateServerTlsPolicyLocationnameServertlspolicyString(); } - public static void syncCreateServerTlsPolicyServertlspolicynameServertlspolicyString() - throws Exception { + public static void syncCreateServerTlsPolicyLocationnameServertlspolicyString() throws Exception { // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - ServerTlsPolicyName parent = - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; ServerTlsPolicy response = @@ -43,4 +41,4 @@ public static void syncCreateServerTlsPolicyServertlspolicynameServertlspolicySt } } } -// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_servertlspolicynameservertlspolicystring_sync] +// [END networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_locationnameservertlspolicystring_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java index de5873a4..778fc498 100644 --- a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/createservertlspolicy/SyncCreateServerTlsPolicyStringServertlspolicyString.java @@ -17,9 +17,9 @@ package com.google.cloud.networksecurity.v1beta1.samples; // [START networksecurity_v1beta1_generated_networksecurityclient_createservertlspolicy_stringservertlspolicystring_sync] +import com.google.cloud.networksecurity.v1beta1.LocationName; import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy; -import com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyName; public class SyncCreateServerTlsPolicyStringServertlspolicyString { @@ -31,8 +31,7 @@ public static void syncCreateServerTlsPolicyStringServertlspolicyString() throws // This snippet has been automatically generated for illustrative purposes only. // It may require modifications to work in your environment. try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { - String parent = - ServerTlsPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVER_TLS_POLICY]").toString(); + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ServerTlsPolicy serverTlsPolicy = ServerTlsPolicy.newBuilder().build(); String serverTlsPolicyId = "serverTlsPolicyId-1966046011"; ServerTlsPolicy response = diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/AsyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 00000000..9dc29e2f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,50 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = networkSecurityClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/SyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 00000000..deb52a06 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,47 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getiampolicy_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = networkSecurityClient.getIamPolicy(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/AsyncGetLocation.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/AsyncGetLocation.java new file mode 100644 index 00000000..b4ee9eae --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/AsyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = networkSecurityClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getlocation_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/SyncGetLocation.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/SyncGetLocation.java new file mode 100644 index 00000000..b8e22b31 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/getlocation/SyncGetLocation.java @@ -0,0 +1,39 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_getlocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = networkSecurityClient.getLocation(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_getlocation_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocations.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocations.java new file mode 100644 index 00000000..dc382319 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocations.java @@ -0,0 +1,51 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + networkSecurityClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listlocations_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocationsPaged.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 00000000..5157ef85 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/AsyncListLocationsPaged.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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listlocations_paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + networkSecurityClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listlocations_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/SyncListLocations.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/SyncListLocations.java new file mode 100644 index 00000000..9cd01181 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/listlocations/SyncListLocations.java @@ -0,0 +1,47 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_listlocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : networkSecurityClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_listlocations_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/AsyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 00000000..94670d43 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = networkSecurityClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_setiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/SyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 00000000..d23430c8 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_setiampolicy_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = networkSecurityClient.setIamPolicy(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_setiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/AsyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 00000000..dbd9629b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + networkSecurityClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_testiampermissions_async] diff --git a/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/SyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 00000000..a3d3d3cf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/networksecurity/v1beta1/networksecurityclient/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,47 @@ +/* + * 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.cloud.networksecurity.v1beta1.samples; + +// [START networksecurity_v1beta1_generated_networksecurityclient_testiampermissions_sync] +import com.google.cloud.networksecurity.v1beta1.AuthorizationPolicyName; +import com.google.cloud.networksecurity.v1beta1.NetworkSecurityClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = networkSecurityClient.testIamPermissions(request); + } + } +} +// [END networksecurity_v1beta1_generated_networksecurityclient_testiampermissions_sync] From 077a36b010f418c34d155296ce76ccceeecb6a96 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 14:06:12 +0000 Subject: [PATCH 14/14] chore(main): release 0.6.0 (#182) :robot: I have created a release *beep* *boop* --- ## [0.6.0](https://github.com/googleapis/java-network-security/compare/v0.5.1...v0.6.0) (2022-08-08) ### Features * publish cloud networksecurity v1 ([#183](https://github.com/googleapis/java-network-security/issues/183)) ([9c37c12](https://github.com/googleapis/java-network-security/commit/9c37c12219ccad6f1d8a73a54636d9b4a8bd9593)) ### Bug Fixes * enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-network-security/issues/1485)) ([#181](https://github.com/googleapis/java-network-security/issues/181)) ([47d1104](https://github.com/googleapis/java-network-security/commit/47d1104ec950d5c93106821f8bbae8cfcf9e3111)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#187](https://github.com/googleapis/java-network-security/issues/187)) ([36d3cdc](https://github.com/googleapis/java-network-security/commit/36d3cdca32a4103e610f91a89955b9ce98e5f953)) ### Documentation * update the comments of various networksecurity resources ([#186](https://github.com/googleapis/java-network-security/issues/186)) ([0b8e3c9](https://github.com/googleapis/java-network-security/commit/0b8e3c9bd8628c6acf251bc70c3eeb6fcede88f2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 22 +++++++++++++++++++ google-cloud-network-security-bom/pom.xml | 12 +++++----- google-cloud-network-security/pom.xml | 4 ++-- grpc-google-cloud-network-security-v1/pom.xml | 4 ++-- .../pom.xml | 4 ++-- pom.xml | 12 +++++----- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- versions.txt | 10 ++++----- 9 files changed, 49 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ee255fc..86631aff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [0.6.0](https://github.com/googleapis/java-network-security/compare/v0.5.1...v0.6.0) (2022-08-08) + + +### Features + +* publish cloud networksecurity v1 ([#183](https://github.com/googleapis/java-network-security/issues/183)) ([9c37c12](https://github.com/googleapis/java-network-security/commit/9c37c12219ccad6f1d8a73a54636d9b4a8bd9593)) + + +### Bug Fixes + +* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-network-security/issues/1485)) ([#181](https://github.com/googleapis/java-network-security/issues/181)) ([47d1104](https://github.com/googleapis/java-network-security/commit/47d1104ec950d5c93106821f8bbae8cfcf9e3111)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#187](https://github.com/googleapis/java-network-security/issues/187)) ([36d3cdc](https://github.com/googleapis/java-network-security/commit/36d3cdca32a4103e610f91a89955b9ce98e5f953)) + + +### Documentation + +* update the comments of various networksecurity resources ([#186](https://github.com/googleapis/java-network-security/issues/186)) ([0b8e3c9](https://github.com/googleapis/java-network-security/commit/0b8e3c9bd8628c6acf251bc70c3eeb6fcede88f2)) + ## [0.5.1](https://github.com/googleapis/java-network-security/compare/v0.5.0...v0.5.1) (2022-07-01) diff --git a/google-cloud-network-security-bom/pom.xml b/google-cloud-network-security-bom/pom.xml index 320d5446..03e84ff4 100644 --- a/google-cloud-network-security-bom/pom.xml +++ b/google-cloud-network-security-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-network-security-bom - 0.5.2-SNAPSHOT + 0.6.0 pom com.google.cloud @@ -56,27 +56,27 @@ com.google.cloud google-cloud-network-security - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc grpc-google-cloud-network-security-v1beta1 - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc grpc-google-cloud-network-security-v1 - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc proto-google-cloud-network-security-v1beta1 - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc proto-google-cloud-network-security-v1 - 0.5.2-SNAPSHOT + 0.6.0 diff --git a/google-cloud-network-security/pom.xml b/google-cloud-network-security/pom.xml index 8ca6b5cb..6fd9cf98 100644 --- a/google-cloud-network-security/pom.xml +++ b/google-cloud-network-security/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-network-security - 0.5.2-SNAPSHOT + 0.6.0 jar Google Network Security API https://github.com/googleapis/java-network-security @@ -11,7 +11,7 @@ com.google.cloud google-cloud-network-security-parent - 0.5.2-SNAPSHOT + 0.6.0 google-cloud-network-security diff --git a/grpc-google-cloud-network-security-v1/pom.xml b/grpc-google-cloud-network-security-v1/pom.xml index 6edf2cda..f9520697 100644 --- a/grpc-google-cloud-network-security-v1/pom.xml +++ b/grpc-google-cloud-network-security-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-network-security-v1 - 0.5.2-SNAPSHOT + 0.6.0 grpc-google-cloud-network-security-v1 GRPC library for google-cloud-network-security com.google.cloud google-cloud-network-security-parent - 0.5.2-SNAPSHOT + 0.6.0 diff --git a/grpc-google-cloud-network-security-v1beta1/pom.xml b/grpc-google-cloud-network-security-v1beta1/pom.xml index 9076f395..65960ac4 100644 --- a/grpc-google-cloud-network-security-v1beta1/pom.xml +++ b/grpc-google-cloud-network-security-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-network-security-v1beta1 - 0.5.2-SNAPSHOT + 0.6.0 grpc-google-cloud-network-security-v1beta1 GRPC library for google-cloud-network-security com.google.cloud google-cloud-network-security-parent - 0.5.2-SNAPSHOT + 0.6.0 diff --git a/pom.xml b/pom.xml index 1f1451f2..1c512efd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-network-security-parent pom - 0.5.2-SNAPSHOT + 0.6.0 Google Network Security API Parent https://github.com/googleapis/java-network-security @@ -69,27 +69,27 @@ com.google.cloud google-cloud-network-security - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc proto-google-cloud-network-security-v1 - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc grpc-google-cloud-network-security-v1 - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc grpc-google-cloud-network-security-v1beta1 - 0.5.2-SNAPSHOT + 0.6.0 com.google.api.grpc proto-google-cloud-network-security-v1beta1 - 0.5.2-SNAPSHOT + 0.6.0 diff --git a/proto-google-cloud-network-security-v1/pom.xml b/proto-google-cloud-network-security-v1/pom.xml index 601ec36e..192ec9fa 100644 --- a/proto-google-cloud-network-security-v1/pom.xml +++ b/proto-google-cloud-network-security-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-network-security-v1 - 0.5.2-SNAPSHOT + 0.6.0 proto-google-cloud-network-security-v1 Proto library for google-cloud-network-security com.google.cloud google-cloud-network-security-parent - 0.5.2-SNAPSHOT + 0.6.0 diff --git a/proto-google-cloud-network-security-v1beta1/pom.xml b/proto-google-cloud-network-security-v1beta1/pom.xml index 080727c4..d3efc49d 100644 --- a/proto-google-cloud-network-security-v1beta1/pom.xml +++ b/proto-google-cloud-network-security-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-network-security-v1beta1 - 0.5.2-SNAPSHOT + 0.6.0 proto-google-cloud-network-security-v1beta1 Proto library for google-cloud-network-security com.google.cloud google-cloud-network-security-parent - 0.5.2-SNAPSHOT + 0.6.0 diff --git a/versions.txt b/versions.txt index 7ec8539b..6fef4d09 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -google-cloud-network-security:0.5.1:0.5.2-SNAPSHOT -grpc-google-cloud-network-security-v1beta1:0.5.1:0.5.2-SNAPSHOT -proto-google-cloud-network-security-v1beta1:0.5.1:0.5.2-SNAPSHOT -proto-google-cloud-network-security-v1:0.5.1:0.5.2-SNAPSHOT -grpc-google-cloud-network-security-v1:0.5.1:0.5.2-SNAPSHOT +google-cloud-network-security:0.6.0:0.6.0 +grpc-google-cloud-network-security-v1beta1:0.6.0:0.6.0 +proto-google-cloud-network-security-v1beta1:0.6.0:0.6.0 +proto-google-cloud-network-security-v1:0.6.0:0.6.0 +grpc-google-cloud-network-security-v1:0.6.0:0.6.0