From f949b6c984ef3949dd25ae7001461fc748b41383 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 28 Jul 2022 17:50:51 +0000 Subject: [PATCH] feat: initial generation --- .../.github/.OwlBot.lock.yaml | 16 + .../.github/.OwlBot.yaml | 32 + .../.github/CODEOWNERS | 10 + .../.github/ISSUE_TEMPLATE/bug_report.md | 51 + .../.github/ISSUE_TEMPLATE/feature_request.md | 21 + .../.github/ISSUE_TEMPLATE/support_request.md | 7 + .../.github/PULL_REQUEST_TEMPLATE.md | 10 + .../.github/auto-label.yaml | 15 + .../.github/blunderbuss.yml | 7 + .../.github/generated-files-bot.yml | 12 + .../.github/release-please.yml | 3 + .../.github/release-trigger.yml | 1 + .../.github/snippet-bot.yml | 0 .../.github/sync-repo-settings.yaml | 63 + .../.github/trusted-contribution.yml | 3 + .../.github/workflows/approve-readme.yaml | 69 + .../.github/workflows/auto-release.yaml | 103 + .../.github/workflows/ci.yaml | 89 + .../.github/workflows/samples.yaml | 30 + java-beyondcorp-appgateways/.gitignore | 17 + java-beyondcorp-appgateways/.kokoro/build.bat | 18 + java-beyondcorp-appgateways/.kokoro/build.sh | 134 + .../.kokoro/coerce_logs.sh | 37 + .../.kokoro/common.cfg | 13 + java-beyondcorp-appgateways/.kokoro/common.sh | 60 + .../.kokoro/continuous/common.cfg | 25 + .../.kokoro/continuous/java8.cfg | 12 + .../.kokoro/dependencies.sh | 110 + .../.kokoro/nightly/common.cfg | 25 + .../.kokoro/nightly/integration.cfg | 37 + .../.kokoro/nightly/java11-integration.cfg | 37 + .../.kokoro/nightly/java11.cfg | 7 + .../.kokoro/nightly/java7.cfg | 7 + .../.kokoro/nightly/java8-osx.cfg | 3 + .../.kokoro/nightly/java8-win.cfg | 3 + .../.kokoro/nightly/java8.cfg | 12 + .../.kokoro/nightly/samples.cfg | 38 + .../.kokoro/populate-secrets.sh | 43 + .../.kokoro/presubmit/clirr.cfg | 13 + .../.kokoro/presubmit/common.cfg | 34 + .../.kokoro/presubmit/dependencies.cfg | 12 + .../.kokoro/presubmit/graalvm-native-17.cfg | 33 + .../.kokoro/presubmit/graalvm-native.cfg | 33 + .../.kokoro/presubmit/integration.cfg | 33 + .../.kokoro/presubmit/java11.cfg | 7 + .../.kokoro/presubmit/java7.cfg | 7 + .../.kokoro/presubmit/java8-osx.cfg | 3 + .../.kokoro/presubmit/java8-win.cfg | 3 + .../.kokoro/presubmit/java8.cfg | 12 + .../.kokoro/presubmit/linkage-monitor.cfg | 12 + .../.kokoro/presubmit/lint.cfg | 13 + .../.kokoro/presubmit/samples.cfg | 33 + java-beyondcorp-appgateways/.kokoro/readme.sh | 45 + .../.kokoro/release/bump_snapshot.cfg | 53 + .../.kokoro/release/common.cfg | 49 + .../.kokoro/release/common.sh | 50 + .../.kokoro/release/drop.cfg | 6 + .../.kokoro/release/drop.sh | 32 + .../.kokoro/release/promote.cfg | 6 + .../.kokoro/release/promote.sh | 34 + .../.kokoro/release/publish_javadoc.cfg | 23 + .../.kokoro/release/publish_javadoc.sh | 53 + .../.kokoro/release/publish_javadoc11.cfg | 30 + .../.kokoro/release/publish_javadoc11.sh | 63 + .../.kokoro/release/snapshot.cfg | 6 + .../.kokoro/release/snapshot.sh | 33 + .../.kokoro/release/stage.cfg | 19 + .../.kokoro/release/stage.sh | 46 + .../.kokoro/trampoline.sh | 26 + .../.repo-metadata.json | 16 + .../CODE_OF_CONDUCT.md | 94 + java-beyondcorp-appgateways/CONTRIBUTING.md | 92 + java-beyondcorp-appgateways/LICENSE | 201 + java-beyondcorp-appgateways/README.md | 201 + java-beyondcorp-appgateways/SECURITY.md | 7 + .../pom.xml | 94 + .../pom.xml | 139 + .../v1/AppGatewaysServiceClient.java | 1245 +++++ .../v1/AppGatewaysServiceSettings.java | 317 ++ .../appgateways/v1/gapic_metadata.json | 45 + .../appgateways/v1/package-info.java | 54 + .../v1/stub/AppGatewaysServiceStub.java | 118 + .../stub/AppGatewaysServiceStubSettings.java | 703 +++ ...GrpcAppGatewaysServiceCallableFactory.java | 113 + .../v1/stub/GrpcAppGatewaysServiceStub.java | 472 ++ .../v1/AppGatewaysServiceClientTest.java | 739 +++ .../v1/MockAppGatewaysService.java | 59 + .../v1/MockAppGatewaysServiceImpl.java | 145 + .../appgateways/v1/MockIAMPolicy.java | 59 + .../appgateways/v1/MockIAMPolicyImpl.java | 127 + .../appgateways/v1/MockLocations.java | 59 + .../appgateways/v1/MockLocationsImpl.java | 105 + .../pom.xml | 69 + .../v1/AppGatewaysServiceGrpc.java | 764 +++ java-beyondcorp-appgateways/java.header | 15 + .../license-checks.xml | 10 + java-beyondcorp-appgateways/owlbot.py | 24 + java-beyondcorp-appgateways/pom.xml | 188 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 46 + .../beyondcorp/appgateways/v1/AppGateway.java | 4497 +++++++++++++++++ .../appgateways/v1/AppGatewayName.java | 223 + .../v1/AppGatewayOperationMetadata.java | 1867 +++++++ .../AppGatewayOperationMetadataOrBuilder.java | 218 + .../appgateways/v1/AppGatewayOrBuilder.java | 420 ++ .../v1/AppGatewaysServiceProto.java | 294 ++ .../v1/CreateAppGatewayRequest.java | 1517 ++++++ .../v1/CreateAppGatewayRequestOrBuilder.java | 187 + .../v1/DeleteAppGatewayRequest.java | 1014 ++++ .../v1/DeleteAppGatewayRequestOrBuilder.java | 115 + .../appgateways/v1/GetAppGatewayRequest.java | 667 +++ .../v1/GetAppGatewayRequestOrBuilder.java | 56 + .../v1/ListAppGatewaysRequest.java | 1344 +++++ .../v1/ListAppGatewaysRequestOrBuilder.java | 157 + .../v1/ListAppGatewaysResponse.java | 1441 ++++++ .../v1/ListAppGatewaysResponseOrBuilder.java | 155 + .../appgateways/v1/LocationName.java | 192 + .../appgateways/v1/app_gateways_service.proto | 356 ++ java-beyondcorp-appgateways/renovate.json | 74 + .../samples/install-without-bom/pom.xml | 84 + java-beyondcorp-appgateways/samples/pom.xml | 56 + .../samples/snapshot/pom.xml | 83 + .../samples/snippets/pom.xml | 47 + java-beyondcorp-appgateways/versions.txt | 6 + 124 files changed, 23411 insertions(+) create mode 100644 java-beyondcorp-appgateways/.github/.OwlBot.lock.yaml create mode 100644 java-beyondcorp-appgateways/.github/.OwlBot.yaml create mode 100644 java-beyondcorp-appgateways/.github/CODEOWNERS create mode 100644 java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/support_request.md create mode 100644 java-beyondcorp-appgateways/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 java-beyondcorp-appgateways/.github/auto-label.yaml create mode 100644 java-beyondcorp-appgateways/.github/blunderbuss.yml create mode 100644 java-beyondcorp-appgateways/.github/generated-files-bot.yml create mode 100644 java-beyondcorp-appgateways/.github/release-please.yml create mode 100644 java-beyondcorp-appgateways/.github/release-trigger.yml create mode 100644 java-beyondcorp-appgateways/.github/snippet-bot.yml create mode 100644 java-beyondcorp-appgateways/.github/sync-repo-settings.yaml create mode 100644 java-beyondcorp-appgateways/.github/trusted-contribution.yml create mode 100644 java-beyondcorp-appgateways/.github/workflows/approve-readme.yaml create mode 100644 java-beyondcorp-appgateways/.github/workflows/auto-release.yaml create mode 100644 java-beyondcorp-appgateways/.github/workflows/ci.yaml create mode 100644 java-beyondcorp-appgateways/.github/workflows/samples.yaml create mode 100644 java-beyondcorp-appgateways/.gitignore create mode 100644 java-beyondcorp-appgateways/.kokoro/build.bat create mode 100755 java-beyondcorp-appgateways/.kokoro/build.sh create mode 100755 java-beyondcorp-appgateways/.kokoro/coerce_logs.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/common.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/common.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/continuous/common.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/continuous/java8.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/dependencies.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/common.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/integration.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/java11-integration.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/java11.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/java7.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/java8-osx.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/java8-win.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/java8.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/nightly/samples.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/populate-secrets.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/clirr.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/common.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/dependencies.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native-17.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/integration.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/java11.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/java7.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/java8-osx.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/java8-win.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/java8.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/linkage-monitor.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/lint.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/presubmit/samples.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/readme.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/bump_snapshot.cfg create mode 100644 java-beyondcorp-appgateways/.kokoro/release/common.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/common.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/drop.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/drop.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/promote.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/promote.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/snapshot.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/snapshot.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/release/stage.cfg create mode 100755 java-beyondcorp-appgateways/.kokoro/release/stage.sh create mode 100644 java-beyondcorp-appgateways/.kokoro/trampoline.sh create mode 100644 java-beyondcorp-appgateways/.repo-metadata.json create mode 100644 java-beyondcorp-appgateways/CODE_OF_CONDUCT.md create mode 100644 java-beyondcorp-appgateways/CONTRIBUTING.md create mode 100644 java-beyondcorp-appgateways/LICENSE create mode 100644 java-beyondcorp-appgateways/README.md create mode 100644 java-beyondcorp-appgateways/SECURITY.md create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways-bom/pom.xml create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/pom.xml create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClient.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceSettings.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/gapic_metadata.json create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/package-info.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStub.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStubSettings.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceCallableFactory.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceStub.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClientTest.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysService.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysServiceImpl.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockIAMPolicy.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockIAMPolicyImpl.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockLocations.java create mode 100644 java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockLocationsImpl.java create mode 100644 java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/pom.xml create mode 100644 java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceGrpc.java create mode 100644 java-beyondcorp-appgateways/java.header create mode 100644 java-beyondcorp-appgateways/license-checks.xml create mode 100644 java-beyondcorp-appgateways/owlbot.py create mode 100644 java-beyondcorp-appgateways/pom.xml create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/clirr-ignored-differences.xml create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/pom.xml create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGateway.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayName.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadata.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadataOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceProto.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequest.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequestOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequest.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequestOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequest.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequestOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequest.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequestOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponse.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponseOrBuilder.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/LocationName.java create mode 100644 java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/proto/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto create mode 100644 java-beyondcorp-appgateways/renovate.json create mode 100644 java-beyondcorp-appgateways/samples/install-without-bom/pom.xml create mode 100644 java-beyondcorp-appgateways/samples/pom.xml create mode 100644 java-beyondcorp-appgateways/samples/snapshot/pom.xml create mode 100644 java-beyondcorp-appgateways/samples/snippets/pom.xml create mode 100644 java-beyondcorp-appgateways/versions.txt diff --git a/java-beyondcorp-appgateways/.github/.OwlBot.lock.yaml b/java-beyondcorp-appgateways/.github/.OwlBot.lock.yaml new file mode 100644 index 000000000000..835375deb3de --- /dev/null +++ b/java-beyondcorp-appgateways/.github/.OwlBot.lock.yaml @@ -0,0 +1,16 @@ +# 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. +docker: + digest: sha256:b47e411068ffc6e6990cb4e0802fbac9a4488dec7f5f424553518ba21abea208 + image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.github/.OwlBot.yaml b/java-beyondcorp-appgateways/.github/.OwlBot.yaml new file mode 100644 index 000000000000..bed4111dbc54 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/.OwlBot.yaml @@ -0,0 +1,32 @@ +# Copyright 2021 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. + +docker: + image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/beyondcorp/appgateways/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-beyondcorp-appgateways-$1/src" +- source: "/google/cloud/beyondcorp/appgateways/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-beyondcorp-appgateways-$1/src" +- source: "/google/cloud/beyondcorp/appgateways/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-beyondcorp-appgateways/src" diff --git a/java-beyondcorp-appgateways/.github/CODEOWNERS b/java-beyondcorp-appgateways/.github/CODEOWNERS new file mode 100644 index 000000000000..30fdb7b9c8f7 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +* @googleapis/yoshi-java + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/bug_report.md b/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..d1e13358a71a --- /dev/null +++ b/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-beyondcorp-appgateways/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/feature_request.md b/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000000..754e30c68a00 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/support_request.md b/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 000000000000..995869032125 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/java-beyondcorp-appgateways/.github/PULL_REQUEST_TEMPLATE.md b/java-beyondcorp-appgateways/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..a4292122f129 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +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-beyondcorp-appgateways/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). diff --git a/java-beyondcorp-appgateways/.github/auto-label.yaml b/java-beyondcorp-appgateways/.github/auto-label.yaml new file mode 100644 index 000000000000..4caef688b745 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/auto-label.yaml @@ -0,0 +1,15 @@ +# Copyright 2021 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. +requestsize: + enabled: true diff --git a/java-beyondcorp-appgateways/.github/blunderbuss.yml b/java-beyondcorp-appgateways/.github/blunderbuss.yml new file mode 100644 index 000000000000..2176b0543214 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.github/generated-files-bot.yml b/java-beyondcorp-appgateways/.github/generated-files-bot.yml new file mode 100644 index 000000000000..c644a24e1129 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/generated-files-bot.yml @@ -0,0 +1,12 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/java-beyondcorp-appgateways/.github/release-please.yml b/java-beyondcorp-appgateways/.github/release-please.yml new file mode 100644 index 000000000000..8ca7f9cabc29 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/java-beyondcorp-appgateways/.github/release-trigger.yml b/java-beyondcorp-appgateways/.github/release-trigger.yml new file mode 100644 index 000000000000..d4ca94189e16 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/java-beyondcorp-appgateways/.github/snippet-bot.yml b/java-beyondcorp-appgateways/.github/snippet-bot.yml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java-beyondcorp-appgateways/.github/sync-repo-settings.yaml b/java-beyondcorp-appgateways/.github/sync-repo-settings.yaml new file mode 100644 index 000000000000..72acb9d8fa25 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/sync-repo-settings.yaml @@ -0,0 +1,63 @@ +# 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. +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for main branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `main` +- pattern: main + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (11)" + - "lint" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" + - "OwlBot Post Processor" + - "Kokoro - Test: Java GraalVM Native Image" + - "Kokoro - Test: Java 17 GraalVM Native Image" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push +- team: java-samples-reviewers + permission: push + diff --git a/java-beyondcorp-appgateways/.github/trusted-contribution.yml b/java-beyondcorp-appgateways/.github/trusted-contribution.yml new file mode 100644 index 000000000000..a0ba1f7d9078 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/trusted-contribution.yml @@ -0,0 +1,3 @@ +trustedContributors: +- renovate-bot +- gcf-owl-bot[bot] diff --git a/java-beyondcorp-appgateways/.github/workflows/approve-readme.yaml b/java-beyondcorp-appgateways/.github/workflows/approve-readme.yaml new file mode 100644 index 000000000000..f5fc7d5169eb --- /dev/null +++ b/java-beyondcorp-appgateways/.github/workflows/approve-readme.yaml @@ -0,0 +1,69 @@ +# 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v6 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/java-beyondcorp-appgateways/.github/workflows/auto-release.yaml b/java-beyondcorp-appgateways/.github/workflows/auto-release.yaml new file mode 100644 index 000000000000..7a106d007edf --- /dev/null +++ b/java-beyondcorp-appgateways/.github/workflows/auto-release.yaml @@ -0,0 +1,103 @@ +# 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-please') + steps: + - uses: actions/github-script@v6 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore(main): release " + if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.rest.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.rest.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.rest.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); diff --git a/java-beyondcorp-appgateways/.github/workflows/ci.yaml b/java-beyondcorp-appgateways/.github/workflows/ci.yaml new file mode 100644 index 000000000000..e3bb26e37719 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/workflows/ci.yaml @@ -0,0 +1,89 @@ +# 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [8, 11, 17] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + 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: + distribution: zulu + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11, 17] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 11 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/java-beyondcorp-appgateways/.github/workflows/samples.yaml b/java-beyondcorp-appgateways/.github/workflows/samples.yaml new file mode 100644 index 000000000000..912ed8b2b027 --- /dev/null +++ b/java-beyondcorp-appgateways/.github/workflows/samples.yaml @@ -0,0 +1,30 @@ +# 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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/java-beyondcorp-appgateways/.gitignore b/java-beyondcorp-appgateways/.gitignore new file mode 100644 index 000000000000..069d08fc73e8 --- /dev/null +++ b/java-beyondcorp-appgateways/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/java-beyondcorp-appgateways/.kokoro/build.bat b/java-beyondcorp-appgateways/.kokoro/build.bat new file mode 100644 index 000000000000..067cf4a4c489 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/build.bat @@ -0,0 +1,18 @@ +:: 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. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/java-beyondcorp-appgateways/.kokoro/build.sh b/java-beyondcorp-appgateways/.kokoro/build.sh new file mode 100755 index 000000000000..6ce097d22c50 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/build.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Maven & Java version +mvn -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check -B -ntp + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc -B -ntp + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +graalvm) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; +graalvm17) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; +samples) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + + pushd ${SAMPLES_DIR} + mvn -B \ + -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -ntp -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-beyondcorp-appgateways +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/java-beyondcorp-appgateways/.kokoro/coerce_logs.sh b/java-beyondcorp-appgateways/.kokoro/coerce_logs.sh new file mode 100755 index 000000000000..46edbf7f2fcd --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/coerce_logs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2019 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. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/java-beyondcorp-appgateways/.kokoro/common.cfg b/java-beyondcorp-appgateways/.kokoro/common.cfg new file mode 100644 index 000000000000..c31972647367 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-beyondcorp-appgateways/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/build.sh" +} diff --git a/java-beyondcorp-appgateways/.kokoro/common.sh b/java-beyondcorp-appgateways/.kokoro/common.sh new file mode 100644 index 000000000000..f8f957af1112 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/common.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# 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 +# +# 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. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } + +## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/continuous/common.cfg b/java-beyondcorp-appgateways/.kokoro/continuous/common.cfg new file mode 100644 index 000000000000..6ee7eb43a7b9 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-beyondcorp-appgateways/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/java-beyondcorp-appgateways/.kokoro/continuous/java8.cfg b/java-beyondcorp-appgateways/.kokoro/continuous/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/java-beyondcorp-appgateways/.kokoro/dependencies.sh b/java-beyondcorp-appgateways/.kokoro/dependencies.sh new file mode 100755 index 000000000000..d7476cfe9727 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/dependencies.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail +shopt -s nullglob + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +function determineMavenOpts() { + local javaVersion=$( + # filter down to the version line, then pull out the version between quotes, + # then trim the version number down to its minimal number (removing any + # update or suffix number). + java -version 2>&1 | grep "version" \ + | sed -E 's/^.*"(.*?)".*$/\1/g' \ + | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' + ) + + if [[ $javaVersion == 17* ]] + then + # MaxPermSize is no longer supported as of jdk 17 + echo -n "-Xmx1024m" + else + echo -n "-Xmx1024m -XX:MaxPermSize=128m" + fi +} + +export MAVEN_OPTS=$(determineMavenOpts) + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dmaven.javadoc.skip=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in **/.flattened-pom.xml +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/common.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/common.cfg new file mode 100644 index 000000000000..6ee7eb43a7b9 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-beyondcorp-appgateways/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/integration.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/integration.cfg new file mode 100644 index 000000000000..a2907a257b2b --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/java11-integration.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 000000000000..58049cc38f11 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/java11-integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/java11014" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/java11.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/java7.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/java8-osx.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 000000000000..539a95b4a9b4 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appgateways/.kokoro/build.sh" diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/java8-win.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/java8-win.cfg new file mode 100644 index 000000000000..ee9e14e73ab7 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appgateways/.kokoro/build.bat" diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/java8.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/java-beyondcorp-appgateways/.kokoro/nightly/samples.cfg b/java-beyondcorp-appgateways/.kokoro/nightly/samples.cfg new file mode 100644 index 000000000000..9761fd8648cb --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} diff --git a/java-beyondcorp-appgateways/.kokoro/populate-secrets.sh b/java-beyondcorp-appgateways/.kokoro/populate-secrets.sh new file mode 100755 index 000000000000..f52514257ef0 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# 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 +# +# 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. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/clirr.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/clirr.cfg new file mode 100644 index 000000000000..ec572442e2e7 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/common.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/common.cfg new file mode 100644 index 000000000000..191e5baeb9ca --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-beyondcorp-appgateways/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/dependencies.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 000000000000..817460e0e47c --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/dependencies.sh" +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native-17.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native-17.cfg new file mode 100644 index 000000000000..a3f7fb9d4943 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native-17.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm17" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native.cfg new file mode 100644 index 000000000000..4c7225ec924e --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/graalvm-native.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/integration.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/integration.cfg new file mode 100644 index 000000000000..dded67a9d54a --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/java11.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/java7.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/java8-osx.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 000000000000..539a95b4a9b4 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appgateways/.kokoro/build.sh" diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/java8-win.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 000000000000..ee9e14e73ab7 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-beyondcorp-appgateways/.kokoro/build.bat" diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/java8.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/linkage-monitor.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 000000000000..691277f7bc11 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/lint.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/lint.cfg new file mode 100644 index 000000000000..6d323c8ae768 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/presubmit/samples.cfg b/java-beyondcorp-appgateways/.kokoro/presubmit/samples.cfg new file mode 100644 index 000000000000..01e0960047b8 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/readme.sh b/java-beyondcorp-appgateways/.kokoro/readme.sh new file mode 100755 index 000000000000..2962f1686db2 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/readme.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# 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 +# +# 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. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-beyondcorp-appgateways + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool + +set +e +python3.6 -m autosynth.synth \ + --repository=googleapis/java-beyondcorp-appgateways \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/java-beyondcorp-appgateways/.kokoro/release/bump_snapshot.cfg b/java-beyondcorp-appgateways/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 000000000000..d3ccf53aec2d --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-beyondcorp-appgateways/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/java-beyondcorp-appgateways/.kokoro/release/common.cfg b/java-beyondcorp-appgateways/.kokoro/release/common.cfg new file mode 100644 index 000000000000..bf0993b029e7 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-beyondcorp-appgateways/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/java-beyondcorp-appgateways/.kokoro/release/common.sh b/java-beyondcorp-appgateways/.kokoro/release/common.sh new file mode 100755 index 000000000000..7f78ee414faf --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 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. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/release/drop.cfg b/java-beyondcorp-appgateways/.kokoro/release/drop.cfg new file mode 100644 index 000000000000..281f2bf09d02 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/drop.sh" +} diff --git a/java-beyondcorp-appgateways/.kokoro/release/drop.sh b/java-beyondcorp-appgateways/.kokoro/release/drop.sh new file mode 100755 index 000000000000..742ec1a88600 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-beyondcorp-appgateways/.kokoro/release/promote.cfg b/java-beyondcorp-appgateways/.kokoro/release/promote.cfg new file mode 100644 index 000000000000..253289493eaa --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/promote.sh" +} diff --git a/java-beyondcorp-appgateways/.kokoro/release/promote.sh b/java-beyondcorp-appgateways/.kokoro/release/promote.sh new file mode 100755 index 000000000000..3cac3d8a97d7 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.cfg b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 000000000000..58ad960ccad5 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,23 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.sh b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.sh new file mode 100755 index 000000000000..0ca089904b73 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-beyondcorp-appgateways +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} diff --git a/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.cfg b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 000000000000..48ddbc1d4eb1 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.sh b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 000000000000..75f967222e98 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# Copyright 2021 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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-beyondcorp-appgateways +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# cloud RAD generation +mvn clean javadoc:aggregate -B -q -P docFX +# include CHANGELOG +cp CHANGELOG.md target/docfx-yml/history.md + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx diff --git a/java-beyondcorp-appgateways/.kokoro/release/snapshot.cfg b/java-beyondcorp-appgateways/.kokoro/release/snapshot.cfg new file mode 100644 index 000000000000..7576913caadb --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/.kokoro/release/snapshot.sh b/java-beyondcorp-appgateways/.kokoro/release/snapshot.sh new file mode 100755 index 000000000000..1f55b77024d8 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/java-beyondcorp-appgateways/.kokoro/release/stage.cfg b/java-beyondcorp-appgateways/.kokoro/release/stage.cfg new file mode 100644 index 000000000000..0d3c809b657f --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-beyondcorp-appgateways/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-beyondcorp-appgateways/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-beyondcorp-appgateways" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/java-beyondcorp-appgateways/.kokoro/release/stage.sh b/java-beyondcorp-appgateways/.kokoro/release/stage.sh new file mode 100755 index 000000000000..1dba8de10857 --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/release/stage.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2018 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. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +source $(dirname "$0")/../common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -Dclirr.skip=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi diff --git a/java-beyondcorp-appgateways/.kokoro/trampoline.sh b/java-beyondcorp-appgateways/.kokoro/trampoline.sh new file mode 100644 index 000000000000..8b69b793c9ec --- /dev/null +++ b/java-beyondcorp-appgateways/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 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. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/java-beyondcorp-appgateways/.repo-metadata.json b/java-beyondcorp-appgateways/.repo-metadata.json new file mode 100644 index 000000000000..93cfa1ed1d14 --- /dev/null +++ b/java-beyondcorp-appgateways/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "beyondcorp-appgateways", + "name_pretty": "BeyondCorp AppGateways", + "product_documentation": "https://cloud.google.com/beyondcorp-enterprise/", + "api_description": "A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-beyondcorp-appgateways/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-beyondcorp-appgateways", + "repo_short": "java-beyondcorp-appgateways", + "distribution_name": "com.google.cloud:google-cloud-beyondcorp-appgateways", + "api_id": "beyondcorp-appgateways.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/CODE_OF_CONDUCT.md b/java-beyondcorp-appgateways/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/java-beyondcorp-appgateways/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/java-beyondcorp-appgateways/CONTRIBUTING.md b/java-beyondcorp-appgateways/CONTRIBUTING.md new file mode 100644 index 000000000000..b65dd279c946 --- /dev/null +++ b/java-beyondcorp-appgateways/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +All code samples must be in compliance with the [java sample formatting guide][3]. +Code Samples must be bundled in separate Maven modules. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 8 whereas samples can have + Java version of Java 11. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn clean verify +``` + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/java-beyondcorp-appgateways/LICENSE b/java-beyondcorp-appgateways/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/java-beyondcorp-appgateways/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/java-beyondcorp-appgateways/README.md b/java-beyondcorp-appgateways/README.md new file mode 100644 index 000000000000..9e09383a26f7 --- /dev/null +++ b/java-beyondcorp-appgateways/README.md @@ -0,0 +1,201 @@ +# Google BeyondCorp AppGateways Client for Java + +Java idiomatic client for [BeyondCorp AppGateways][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + + +```xml + + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-beyondcorp-appgateways:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-beyondcorp-appgateways" % "0.0.0" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired BeyondCorp AppGateways APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the BeyondCorp AppGateways API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the BeyondCorp AppGateways [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google BeyondCorp AppGateways. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-beyondcorp-appgateways` library. See the [Quickstart](#quickstart) section +to add `google-cloud-beyondcorp-appgateways` as a dependency in your code. + +## About BeyondCorp AppGateways + + +[BeyondCorp AppGateways][product-docs] A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. + +See the [BeyondCorp AppGateways client library docs][javadocs] to learn how to +use this BeyondCorp AppGateways Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +BeyondCorp AppGateways uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/beyondcorp-enterprise/ +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-beyondcorp-appgateways/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-beyondcorp-appgateways/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-beyondcorp-appgateways.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-appgateways&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-beyondcorp-appgateways/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-beyondcorp-appgateways/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-beyondcorp-appgateways/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=beyondcorp-appgateways.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-beyondcorp-appgateways/SECURITY.md b/java-beyondcorp-appgateways/SECURITY.md new file mode 100644 index 000000000000..8b58ae9c01ae --- /dev/null +++ b/java-beyondcorp-appgateways/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways-bom/pom.xml b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways-bom/pom.xml new file mode 100644 index 000000000000..ba8dfcd53532 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways-bom/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-appgateways-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 1.2.7 + + + Google BeyondCorp AppGateways BOM + https://github.com/googleapis/java-beyondcorp-appgateways + + BOM for BeyondCorp AppGateways + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + neenushaji + Neenu Shaji + neenushaji@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-beyondcorp-appgateways.git + scm:git:git@github.com:googleapis/java-beyondcorp-appgateways.git + https://github.com/googleapis/java-beyondcorp-appgateways + + + + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-appgateways-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-beyondcorp-appgateways-v1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/pom.xml b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/pom.xml new file mode 100644 index 000000000000..753b8762a579 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.1-SNAPSHOT + jar + Google BeyondCorp AppGateways + https://github.com/googleapis/java-beyondcorp-appgateways + BeyondCorp AppGateways A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. + + com.google.cloud + google-cloud-beyondcorp-appgateways-parent + 0.0.1-SNAPSHOT + + + google-cloud-beyondcorp-appgateways + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-beyondcorp-appgateways-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13.2 + + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-appgateways-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClient.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClient.java new file mode 100644 index 000000000000..abfb60d08320 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClient.java @@ -0,0 +1,1245 @@ +/* + * 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.beyondcorp.appgateways.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.beyondcorp.appgateways.v1.stub.AppGatewaysServiceStub; +import com.google.cloud.beyondcorp.appgateways.v1.stub.AppGatewaysServiceStubSettings; +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.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 java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: ## API Overview + * + *

The `beyondcorp.googleapis.com` service implements the Google Cloud BeyondCorp API. + * + *

## Data Model + * + *

The AppGatewaysService exposes the following resources: + * + *

    + *
  • AppGateways, named as follows: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`. + *
+ * + *

The AppGatewaysService service provides methods to manage (create/read/update/delete) + * BeyondCorp AppGateways. + * + *

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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+ *   AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]");
+ *   AppGateway response = appGatewaysServiceClient.getAppGateway(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AppGatewaysServiceClient 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 AppGatewaysServiceSettings 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.
+ * AppGatewaysServiceSettings appGatewaysServiceSettings =
+ *     AppGatewaysServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AppGatewaysServiceClient appGatewaysServiceClient =
+ *     AppGatewaysServiceClient.create(appGatewaysServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class AppGatewaysServiceClient implements BackgroundResource { + private final AppGatewaysServiceSettings settings; + private final AppGatewaysServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AppGatewaysServiceClient with default settings. */ + public static final AppGatewaysServiceClient create() throws IOException { + return create(AppGatewaysServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AppGatewaysServiceClient, 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 AppGatewaysServiceClient create(AppGatewaysServiceSettings settings) + throws IOException { + return new AppGatewaysServiceClient(settings); + } + + /** + * Constructs an instance of AppGatewaysServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(AppGatewaysServiceSettings). + */ + public static final AppGatewaysServiceClient create(AppGatewaysServiceStub stub) { + return new AppGatewaysServiceClient(stub); + } + + /** + * Constructs an instance of AppGatewaysServiceClient, 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 AppGatewaysServiceClient(AppGatewaysServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AppGatewaysServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected AppGatewaysServiceClient(AppGatewaysServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AppGatewaysServiceSettings getSettings() { + return settings; + } + + public AppGatewaysServiceStub 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 AppGateways 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (AppGateway element : appGatewaysServiceClient.listAppGateways(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppGatewaysPagedResponse listAppGateways(LocationName parent) { + ListAppGatewaysRequest request = + ListAppGatewaysRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAppGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppGateways 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (AppGateway element : appGatewaysServiceClient.listAppGateways(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAppGatewaysPagedResponse listAppGateways(String parent) { + ListAppGatewaysRequest request = ListAppGatewaysRequest.newBuilder().setParent(parent).build(); + return listAppGateways(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppGateways 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   ListAppGatewaysRequest request =
+   *       ListAppGatewaysRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (AppGateway element : appGatewaysServiceClient.listAppGateways(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 ListAppGatewaysPagedResponse listAppGateways(ListAppGatewaysRequest request) { + return listAppGatewaysPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppGateways 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   ListAppGatewaysRequest request =
+   *       ListAppGatewaysRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.listAppGatewaysPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AppGateway element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAppGatewaysPagedCallable() { + return stub.listAppGatewaysPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists AppGateways 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   ListAppGatewaysRequest request =
+   *       ListAppGatewaysRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListAppGatewaysResponse response =
+   *         appGatewaysServiceClient.listAppGatewaysCallable().call(request);
+   *     for (AppGateway element : response.getAppGatewaysList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAppGatewaysCallable() { + return stub.listAppGatewaysCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]");
+   *   AppGateway response = appGatewaysServiceClient.getAppGateway(name);
+   * }
+   * }
+ * + * @param name Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppGateway getAppGateway(AppGatewayName name) { + GetAppGatewayRequest request = + GetAppGatewayRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAppGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   String name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString();
+   *   AppGateway response = appGatewaysServiceClient.getAppGateway(name);
+   * }
+   * }
+ * + * @param name Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppGateway getAppGateway(String name) { + GetAppGatewayRequest request = GetAppGatewayRequest.newBuilder().setName(name).build(); + return getAppGateway(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single AppGateway. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   GetAppGatewayRequest request =
+   *       GetAppGatewayRequest.newBuilder()
+   *           .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.getAppGatewayCallable().futureCall(request);
+   *   // Do something.
+   *   AppGateway response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAppGatewayCallable() { + return stub.getAppGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppGateway 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   AppGateway appGateway = AppGateway.newBuilder().build();
+   *   String appGatewayId = "appGatewayId355682654";
+   *   AppGateway response =
+   *       appGatewaysServiceClient.createAppGatewayAsync(parent, appGateway, appGatewayId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource project name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * @param appGateway Required. A BeyondCorp AppGateway resource. + * @param appGatewayId Optional. User-settable AppGateway resource ID. * Must start with a + * letter. * Must contain between 4-63 characters from `/[a-z][0-9]-/`. * Must end + * with a number or a letter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createAppGatewayAsync( + LocationName parent, AppGateway appGateway, String appGatewayId) { + CreateAppGatewayRequest request = + CreateAppGatewayRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAppGateway(appGateway) + .setAppGatewayId(appGatewayId) + .build(); + return createAppGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppGateway 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   AppGateway appGateway = AppGateway.newBuilder().build();
+   *   String appGatewayId = "appGatewayId355682654";
+   *   AppGateway response =
+   *       appGatewaysServiceClient.createAppGatewayAsync(parent, appGateway, appGatewayId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource project name of the AppGateway location using the form: + * `projects/{project_id}/locations/{location_id}` + * @param appGateway Required. A BeyondCorp AppGateway resource. + * @param appGatewayId Optional. User-settable AppGateway resource ID. * Must start with a + * letter. * Must contain between 4-63 characters from `/[a-z][0-9]-/`. * Must end + * with a number or a letter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createAppGatewayAsync( + String parent, AppGateway appGateway, String appGatewayId) { + CreateAppGatewayRequest request = + CreateAppGatewayRequest.newBuilder() + .setParent(parent) + .setAppGateway(appGateway) + .setAppGatewayId(appGatewayId) + .build(); + return createAppGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppGateway 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   CreateAppGatewayRequest request =
+   *       CreateAppGatewayRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppGatewayId("appGatewayId355682654")
+   *           .setAppGateway(AppGateway.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   AppGateway response = appGatewaysServiceClient.createAppGatewayAsync(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 createAppGatewayAsync( + CreateAppGatewayRequest request) { + return createAppGatewayOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppGateway 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   CreateAppGatewayRequest request =
+   *       CreateAppGatewayRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppGatewayId("appGatewayId355682654")
+   *           .setAppGateway(AppGateway.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       appGatewaysServiceClient.createAppGatewayOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AppGateway response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createAppGatewayOperationCallable() { + return stub.createAppGatewayOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new AppGateway 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   CreateAppGatewayRequest request =
+   *       CreateAppGatewayRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAppGatewayId("appGatewayId355682654")
+   *           .setAppGateway(AppGateway.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.createAppGatewayCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createAppGatewayCallable() { + return stub.createAppGatewayCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]");
+   *   appGatewaysServiceClient.deleteAppGatewayAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAppGatewayAsync( + AppGatewayName name) { + DeleteAppGatewayRequest request = + DeleteAppGatewayRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteAppGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   String name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString();
+   *   appGatewaysServiceClient.deleteAppGatewayAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. BeyondCorp AppGateway name using the form: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteAppGatewayAsync( + String name) { + DeleteAppGatewayRequest request = DeleteAppGatewayRequest.newBuilder().setName(name).build(); + return deleteAppGatewayAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   DeleteAppGatewayRequest request =
+   *       DeleteAppGatewayRequest.newBuilder()
+   *           .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   appGatewaysServiceClient.deleteAppGatewayAsync(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 deleteAppGatewayAsync( + DeleteAppGatewayRequest request) { + return deleteAppGatewayOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   DeleteAppGatewayRequest request =
+   *       DeleteAppGatewayRequest.newBuilder()
+   *           .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       appGatewaysServiceClient.deleteAppGatewayOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteAppGatewayOperationCallable() { + return stub.deleteAppGatewayOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single AppGateway. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   DeleteAppGatewayRequest request =
+   *       DeleteAppGatewayRequest.newBuilder()
+   *           .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.deleteAppGatewayCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteAppGatewayCallable() { + return stub.deleteAppGatewayCallable(); + } + + // 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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = appGatewaysServiceClient.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 (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       appGatewaysServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListAppGatewaysPagedResponse + extends AbstractPagedListResponse< + ListAppGatewaysRequest, + ListAppGatewaysResponse, + AppGateway, + ListAppGatewaysPage, + ListAppGatewaysFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAppGatewaysPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAppGatewaysPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAppGatewaysPagedResponse(ListAppGatewaysPage page) { + super(page, ListAppGatewaysFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAppGatewaysPage + extends AbstractPage< + ListAppGatewaysRequest, ListAppGatewaysResponse, AppGateway, ListAppGatewaysPage> { + + private ListAppGatewaysPage( + PageContext context, + ListAppGatewaysResponse response) { + super(context, response); + } + + private static ListAppGatewaysPage createEmptyPage() { + return new ListAppGatewaysPage(null, null); + } + + @Override + protected ListAppGatewaysPage createPage( + PageContext context, + ListAppGatewaysResponse response) { + return new ListAppGatewaysPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAppGatewaysFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAppGatewaysRequest, + ListAppGatewaysResponse, + AppGateway, + ListAppGatewaysPage, + ListAppGatewaysFixedSizeCollection> { + + private ListAppGatewaysFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAppGatewaysFixedSizeCollection createEmptyCollection() { + return new ListAppGatewaysFixedSizeCollection(null, 0); + } + + @Override + protected ListAppGatewaysFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAppGatewaysFixedSizeCollection(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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceSettings.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceSettings.java new file mode 100644 index 000000000000..5738abbdab65 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceSettings.java @@ -0,0 +1,317 @@ +/* + * 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.beyondcorp.appgateways.v1; + +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListAppGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListLocationsPagedResponse; + +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.beyondcorp.appgateways.v1.stub.AppGatewaysServiceStubSettings; +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.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; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AppGatewaysServiceClient}. + * + *

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AppGatewaysServiceSettings.Builder appGatewaysServiceSettingsBuilder =
+ *     AppGatewaysServiceSettings.newBuilder();
+ * appGatewaysServiceSettingsBuilder
+ *     .getAppGatewaySettings()
+ *     .setRetrySettings(
+ *         appGatewaysServiceSettingsBuilder
+ *             .getAppGatewaySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AppGatewaysServiceSettings appGatewaysServiceSettings =
+ *     appGatewaysServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AppGatewaysServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listAppGateways. */ + public PagedCallSettings< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + listAppGatewaysSettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).listAppGatewaysSettings(); + } + + /** Returns the object with the settings used for calls to getAppGateway. */ + public UnaryCallSettings getAppGatewaySettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).getAppGatewaySettings(); + } + + /** Returns the object with the settings used for calls to createAppGateway. */ + public UnaryCallSettings createAppGatewaySettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).createAppGatewaySettings(); + } + + /** Returns the object with the settings used for calls to createAppGateway. */ + public OperationCallSettings + createAppGatewayOperationSettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).createAppGatewayOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteAppGateway. */ + public UnaryCallSettings deleteAppGatewaySettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).deleteAppGatewaySettings(); + } + + /** Returns the object with the settings used for calls to deleteAppGateway. */ + public OperationCallSettings + deleteAppGatewayOperationSettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).deleteAppGatewayOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((AppGatewaysServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final AppGatewaysServiceSettings create(AppGatewaysServiceStubSettings stub) + throws IOException { + return new AppGatewaysServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AppGatewaysServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AppGatewaysServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AppGatewaysServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AppGatewaysServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AppGatewaysServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AppGatewaysServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AppGatewaysServiceStubSettings.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 AppGatewaysServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AppGatewaysServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AppGatewaysServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AppGatewaysServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AppGatewaysServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AppGatewaysServiceStubSettings.newBuilder()); + } + + public AppGatewaysServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AppGatewaysServiceStubSettings.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 listAppGateways. */ + public PagedCallSettings.Builder< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + listAppGatewaysSettings() { + return getStubSettingsBuilder().listAppGatewaysSettings(); + } + + /** Returns the builder for the settings used for calls to getAppGateway. */ + public UnaryCallSettings.Builder getAppGatewaySettings() { + return getStubSettingsBuilder().getAppGatewaySettings(); + } + + /** Returns the builder for the settings used for calls to createAppGateway. */ + public UnaryCallSettings.Builder + createAppGatewaySettings() { + return getStubSettingsBuilder().createAppGatewaySettings(); + } + + /** Returns the builder for the settings used for calls to createAppGateway. */ + public OperationCallSettings.Builder< + CreateAppGatewayRequest, AppGateway, AppGatewayOperationMetadata> + createAppGatewayOperationSettings() { + return getStubSettingsBuilder().createAppGatewayOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAppGateway. */ + public UnaryCallSettings.Builder + deleteAppGatewaySettings() { + return getStubSettingsBuilder().deleteAppGatewaySettings(); + } + + /** Returns the builder for the settings used for calls to deleteAppGateway. */ + public OperationCallSettings.Builder< + DeleteAppGatewayRequest, Empty, AppGatewayOperationMetadata> + deleteAppGatewayOperationSettings() { + return getStubSettingsBuilder().deleteAppGatewayOperationSettings(); + } + + /** 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 AppGatewaysServiceSettings build() throws IOException { + return new AppGatewaysServiceSettings(this); + } + } +} diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/gapic_metadata.json b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/gapic_metadata.json new file mode 100644 index 000000000000..160fc03707b4 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/gapic_metadata.json @@ -0,0 +1,45 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.beyondcorp.appgateways.v1", + "libraryPackage": "com.google.cloud.beyondcorp.appgateways.v1", + "services": { + "AppGatewaysService": { + "clients": { + "grpc": { + "libraryClient": "AppGatewaysServiceClient", + "rpcs": { + "CreateAppGateway": { + "methods": ["createAppGatewayAsync", "createAppGatewayAsync", "createAppGatewayAsync", "createAppGatewayOperationCallable", "createAppGatewayCallable"] + }, + "DeleteAppGateway": { + "methods": ["deleteAppGatewayAsync", "deleteAppGatewayAsync", "deleteAppGatewayAsync", "deleteAppGatewayOperationCallable", "deleteAppGatewayCallable"] + }, + "GetAppGateway": { + "methods": ["getAppGateway", "getAppGateway", "getAppGateway", "getAppGatewayCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListAppGateways": { + "methods": ["listAppGateways", "listAppGateways", "listAppGateways", "listAppGatewaysPagedCallable", "listAppGatewaysCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/package-info.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/package-info.java new file mode 100644 index 000000000000..74540c96b353 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/package-info.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to BeyondCorp API + * + *

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

======================= AppGatewaysServiceClient ======================= + * + *

Service Description: ## API Overview + * + *

The `beyondcorp.googleapis.com` service implements the Google Cloud BeyondCorp API. + * + *

## Data Model + * + *

The AppGatewaysService exposes the following resources: + * + *

    + *
  • AppGateways, named as follows: + * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`. + *
+ * + *

The AppGatewaysService service provides methods to manage (create/read/update/delete) + * BeyondCorp AppGateways. + * + *

Sample for AppGatewaysServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AppGatewaysServiceClient appGatewaysServiceClient = AppGatewaysServiceClient.create()) {
+ *   AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]");
+ *   AppGateway response = appGatewaysServiceClient.getAppGateway(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.beyondcorp.appgateways.v1; + +import javax.annotation.Generated; diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStub.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStub.java new file mode 100644 index 000000000000..d3b1b378c77d --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStub.java @@ -0,0 +1,118 @@ +/* + * 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.beyondcorp.appgateways.v1.stub; + +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListAppGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListLocationsPagedResponse; + +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.beyondcorp.appgateways.v1.AppGateway; +import com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata; +import com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest; +import com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse; +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.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; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AppGatewaysService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AppGatewaysServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listAppGatewaysPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAppGatewaysPagedCallable()"); + } + + public UnaryCallable listAppGatewaysCallable() { + throw new UnsupportedOperationException("Not implemented: listAppGatewaysCallable()"); + } + + public UnaryCallable getAppGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: getAppGatewayCallable()"); + } + + public OperationCallable + createAppGatewayOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createAppGatewayOperationCallable()"); + } + + public UnaryCallable createAppGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: createAppGatewayCallable()"); + } + + public OperationCallable + deleteAppGatewayOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAppGatewayOperationCallable()"); + } + + public UnaryCallable deleteAppGatewayCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAppGatewayCallable()"); + } + + 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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStubSettings.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStubSettings.java new file mode 100644 index 000000000000..da1c12731f7a --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/AppGatewaysServiceStubSettings.java @@ -0,0 +1,703 @@ +/* + * 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.beyondcorp.appgateways.v1.stub; + +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListAppGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListLocationsPagedResponse; + +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.beyondcorp.appgateways.v1.AppGateway; +import com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata; +import com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest; +import com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse; +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.ImmutableList; +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; +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 AppGatewaysServiceStub}. + * + *

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AppGatewaysServiceStubSettings.Builder appGatewaysServiceSettingsBuilder =
+ *     AppGatewaysServiceStubSettings.newBuilder();
+ * appGatewaysServiceSettingsBuilder
+ *     .getAppGatewaySettings()
+ *     .setRetrySettings(
+ *         appGatewaysServiceSettingsBuilder
+ *             .getAppGatewaySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AppGatewaysServiceStubSettings appGatewaysServiceSettings =
+ *     appGatewaysServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AppGatewaysServiceStubSettings 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< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + listAppGatewaysSettings; + private final UnaryCallSettings getAppGatewaySettings; + private final UnaryCallSettings createAppGatewaySettings; + private final OperationCallSettings< + CreateAppGatewayRequest, AppGateway, AppGatewayOperationMetadata> + createAppGatewayOperationSettings; + private final UnaryCallSettings deleteAppGatewaySettings; + private final OperationCallSettings + deleteAppGatewayOperationSettings; + 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< + ListAppGatewaysRequest, ListAppGatewaysResponse, AppGateway> + LIST_APP_GATEWAYS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAppGatewaysRequest injectToken( + ListAppGatewaysRequest payload, String token) { + return ListAppGatewaysRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAppGatewaysRequest injectPageSize( + ListAppGatewaysRequest payload, int pageSize) { + return ListAppGatewaysRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAppGatewaysRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAppGatewaysResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAppGatewaysResponse payload) { + return payload.getAppGatewaysList() == null + ? ImmutableList.of() + : payload.getAppGatewaysList(); + } + }; + + 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< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + LIST_APP_GATEWAYS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAppGatewaysRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_APP_GATEWAYS_PAGE_STR_DESC, request, context); + return ListAppGatewaysPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + 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 listAppGateways. */ + public PagedCallSettings< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + listAppGatewaysSettings() { + return listAppGatewaysSettings; + } + + /** Returns the object with the settings used for calls to getAppGateway. */ + public UnaryCallSettings getAppGatewaySettings() { + return getAppGatewaySettings; + } + + /** Returns the object with the settings used for calls to createAppGateway. */ + public UnaryCallSettings createAppGatewaySettings() { + return createAppGatewaySettings; + } + + /** Returns the object with the settings used for calls to createAppGateway. */ + public OperationCallSettings + createAppGatewayOperationSettings() { + return createAppGatewayOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteAppGateway. */ + public UnaryCallSettings deleteAppGatewaySettings() { + return deleteAppGatewaySettings; + } + + /** Returns the object with the settings used for calls to deleteAppGateway. */ + public OperationCallSettings + deleteAppGatewayOperationSettings() { + return deleteAppGatewayOperationSettings; + } + + /** 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 AppGatewaysServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAppGatewaysServiceStub.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 "beyondcorp.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "beyondcorp.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(AppGatewaysServiceStubSettings.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 AppGatewaysServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listAppGatewaysSettings = settingsBuilder.listAppGatewaysSettings().build(); + getAppGatewaySettings = settingsBuilder.getAppGatewaySettings().build(); + createAppGatewaySettings = settingsBuilder.createAppGatewaySettings().build(); + createAppGatewayOperationSettings = settingsBuilder.createAppGatewayOperationSettings().build(); + deleteAppGatewaySettings = settingsBuilder.deleteAppGatewaySettings().build(); + deleteAppGatewayOperationSettings = settingsBuilder.deleteAppGatewayOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for AppGatewaysServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + listAppGatewaysSettings; + private final UnaryCallSettings.Builder getAppGatewaySettings; + private final UnaryCallSettings.Builder + createAppGatewaySettings; + private final OperationCallSettings.Builder< + CreateAppGatewayRequest, AppGateway, AppGatewayOperationMetadata> + createAppGatewayOperationSettings; + private final UnaryCallSettings.Builder + deleteAppGatewaySettings; + private final OperationCallSettings.Builder< + DeleteAppGatewayRequest, Empty, AppGatewayOperationMetadata> + deleteAppGatewayOperationSettings; + 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; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAppGatewaysSettings = PagedCallSettings.newBuilder(LIST_APP_GATEWAYS_PAGE_STR_FACT); + getAppGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAppGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAppGatewayOperationSettings = OperationCallSettings.newBuilder(); + deleteAppGatewaySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteAppGatewayOperationSettings = 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( + listAppGatewaysSettings, + getAppGatewaySettings, + createAppGatewaySettings, + deleteAppGatewaySettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(AppGatewaysServiceStubSettings settings) { + super(settings); + + listAppGatewaysSettings = settings.listAppGatewaysSettings.toBuilder(); + getAppGatewaySettings = settings.getAppGatewaySettings.toBuilder(); + createAppGatewaySettings = settings.createAppGatewaySettings.toBuilder(); + createAppGatewayOperationSettings = settings.createAppGatewayOperationSettings.toBuilder(); + deleteAppGatewaySettings = settings.deleteAppGatewaySettings.toBuilder(); + deleteAppGatewayOperationSettings = settings.deleteAppGatewayOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAppGatewaysSettings, + getAppGatewaySettings, + createAppGatewaySettings, + deleteAppGatewaySettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 + .listAppGatewaysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getAppGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createAppGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteAppGatewaySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createAppGatewayOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AppGateway.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AppGatewayOperationMetadata.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 + .deleteAppGatewayOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + AppGatewayOperationMetadata.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 listAppGateways. */ + public PagedCallSettings.Builder< + ListAppGatewaysRequest, ListAppGatewaysResponse, ListAppGatewaysPagedResponse> + listAppGatewaysSettings() { + return listAppGatewaysSettings; + } + + /** Returns the builder for the settings used for calls to getAppGateway. */ + public UnaryCallSettings.Builder getAppGatewaySettings() { + return getAppGatewaySettings; + } + + /** Returns the builder for the settings used for calls to createAppGateway. */ + public UnaryCallSettings.Builder + createAppGatewaySettings() { + return createAppGatewaySettings; + } + + /** Returns the builder for the settings used for calls to createAppGateway. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateAppGatewayRequest, AppGateway, AppGatewayOperationMetadata> + createAppGatewayOperationSettings() { + return createAppGatewayOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteAppGateway. */ + public UnaryCallSettings.Builder + deleteAppGatewaySettings() { + return deleteAppGatewaySettings; + } + + /** Returns the builder for the settings used for calls to deleteAppGateway. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeleteAppGatewayRequest, Empty, AppGatewayOperationMetadata> + deleteAppGatewayOperationSettings() { + return deleteAppGatewayOperationSettings; + } + + /** 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 AppGatewaysServiceStubSettings build() throws IOException { + return new AppGatewaysServiceStubSettings(this); + } + } +} diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceCallableFactory.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceCallableFactory.java new file mode 100644 index 000000000000..388704a67a29 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceCallableFactory.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.beyondcorp.appgateways.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 AppGatewaysService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAppGatewaysServiceCallableFactory 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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceStub.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceStub.java new file mode 100644 index 000000000000..9a1dba7ee295 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/stub/GrpcAppGatewaysServiceStub.java @@ -0,0 +1,472 @@ +/* + * 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.beyondcorp.appgateways.v1.stub; + +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListAppGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListLocationsPagedResponse; + +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.beyondcorp.appgateways.v1.AppGateway; +import com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata; +import com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest; +import com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest; +import com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse; +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.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; +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 AppGatewaysService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAppGatewaysServiceStub extends AppGatewaysServiceStub { + private static final MethodDescriptor + listAppGatewaysMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/ListAppGateways") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAppGatewaysRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAppGatewaysResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAppGatewayMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/GetAppGateway") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAppGatewayRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AppGateway.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAppGatewayMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/CreateAppGateway") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAppGatewayRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteAppGatewayMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.beyondcorp.appgateways.v1.AppGatewaysService/DeleteAppGateway") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAppGatewayRequest.getDefaultInstance())) + .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 + listAppGatewaysCallable; + private final UnaryCallable + listAppGatewaysPagedCallable; + private final UnaryCallable getAppGatewayCallable; + private final UnaryCallable createAppGatewayCallable; + private final OperationCallable + createAppGatewayOperationCallable; + private final UnaryCallable deleteAppGatewayCallable; + private final OperationCallable + deleteAppGatewayOperationCallable; + 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; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAppGatewaysServiceStub create(AppGatewaysServiceStubSettings settings) + throws IOException { + return new GrpcAppGatewaysServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAppGatewaysServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAppGatewaysServiceStub( + AppGatewaysServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAppGatewaysServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAppGatewaysServiceStub( + AppGatewaysServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAppGatewaysServiceStub, 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 GrpcAppGatewaysServiceStub( + AppGatewaysServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAppGatewaysServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAppGatewaysServiceStub, 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 GrpcAppGatewaysServiceStub( + AppGatewaysServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listAppGatewaysTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAppGatewaysMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getAppGatewayTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAppGatewayMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createAppGatewayTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAppGatewayMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteAppGatewayTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAppGatewayMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + 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.listAppGatewaysCallable = + callableFactory.createUnaryCallable( + listAppGatewaysTransportSettings, settings.listAppGatewaysSettings(), clientContext); + this.listAppGatewaysPagedCallable = + callableFactory.createPagedCallable( + listAppGatewaysTransportSettings, settings.listAppGatewaysSettings(), clientContext); + this.getAppGatewayCallable = + callableFactory.createUnaryCallable( + getAppGatewayTransportSettings, settings.getAppGatewaySettings(), clientContext); + this.createAppGatewayCallable = + callableFactory.createUnaryCallable( + createAppGatewayTransportSettings, settings.createAppGatewaySettings(), clientContext); + this.createAppGatewayOperationCallable = + callableFactory.createOperationCallable( + createAppGatewayTransportSettings, + settings.createAppGatewayOperationSettings(), + clientContext, + operationsStub); + this.deleteAppGatewayCallable = + callableFactory.createUnaryCallable( + deleteAppGatewayTransportSettings, settings.deleteAppGatewaySettings(), clientContext); + this.deleteAppGatewayOperationCallable = + callableFactory.createOperationCallable( + deleteAppGatewayTransportSettings, + settings.deleteAppGatewayOperationSettings(), + 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()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listAppGatewaysCallable() { + return listAppGatewaysCallable; + } + + @Override + public UnaryCallable + listAppGatewaysPagedCallable() { + return listAppGatewaysPagedCallable; + } + + @Override + public UnaryCallable getAppGatewayCallable() { + return getAppGatewayCallable; + } + + @Override + public UnaryCallable createAppGatewayCallable() { + return createAppGatewayCallable; + } + + @Override + public OperationCallable + createAppGatewayOperationCallable() { + return createAppGatewayOperationCallable; + } + + @Override + public UnaryCallable deleteAppGatewayCallable() { + return deleteAppGatewayCallable; + } + + @Override + public OperationCallable + deleteAppGatewayOperationCallable() { + return deleteAppGatewayOperationCallable; + } + + @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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClientTest.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClientTest.java new file mode 100644 index 000000000000..9d74ae93697a --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceClientTest.java @@ -0,0 +1,739 @@ +/* + * 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.beyondcorp.appgateways.v1; + +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListAppGatewaysPagedResponse; +import static com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceClient.ListLocationsPagedResponse; + +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.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; +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 AppGatewaysServiceClientTest { + private static MockAppGatewaysService mockAppGatewaysService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AppGatewaysServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAppGatewaysService = new MockAppGatewaysService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockAppGatewaysService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AppGatewaysServiceSettings settings = + AppGatewaysServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AppGatewaysServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listAppGatewaysTest() throws Exception { + AppGateway responsesElement = AppGateway.newBuilder().build(); + ListAppGatewaysResponse expectedResponse = + ListAppGatewaysResponse.newBuilder() + .setNextPageToken("") + .addAllAppGateways(Arrays.asList(responsesElement)) + .build(); + mockAppGatewaysService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListAppGatewaysPagedResponse pagedListResponse = client.listAppGateways(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppGatewaysList().get(0), resources.get(0)); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAppGatewaysRequest actualRequest = ((ListAppGatewaysRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAppGatewaysExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAppGateways(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAppGatewaysTest2() throws Exception { + AppGateway responsesElement = AppGateway.newBuilder().build(); + ListAppGatewaysResponse expectedResponse = + ListAppGatewaysResponse.newBuilder() + .setNextPageToken("") + .addAllAppGateways(Arrays.asList(responsesElement)) + .build(); + mockAppGatewaysService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAppGatewaysPagedResponse pagedListResponse = client.listAppGateways(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAppGatewaysList().get(0), resources.get(0)); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAppGatewaysRequest actualRequest = ((ListAppGatewaysRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAppGatewaysExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAppGateways(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAppGatewayTest() throws Exception { + AppGateway expectedResponse = + AppGateway.newBuilder() + .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setUri("uri116076") + .addAllAllocatedConnections(new ArrayList()) + .build(); + mockAppGatewaysService.addResponse(expectedResponse); + + AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]"); + + AppGateway actualResponse = client.getAppGateway(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAppGatewayRequest actualRequest = ((GetAppGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAppGatewayExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]"); + client.getAppGateway(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAppGatewayTest2() throws Exception { + AppGateway expectedResponse = + AppGateway.newBuilder() + .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setUri("uri116076") + .addAllAllocatedConnections(new ArrayList()) + .build(); + mockAppGatewaysService.addResponse(expectedResponse); + + String name = "name3373707"; + + AppGateway actualResponse = client.getAppGateway(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAppGatewayRequest actualRequest = ((GetAppGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAppGatewayExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + String name = "name3373707"; + client.getAppGateway(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAppGatewayTest() throws Exception { + AppGateway expectedResponse = + AppGateway.newBuilder() + .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setUri("uri116076") + .addAllAllocatedConnections(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAppGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppGatewaysService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AppGateway appGateway = AppGateway.newBuilder().build(); + String appGatewayId = "appGatewayId355682654"; + + AppGateway actualResponse = + client.createAppGatewayAsync(parent, appGateway, appGatewayId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAppGatewayRequest actualRequest = ((CreateAppGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(appGateway, actualRequest.getAppGateway()); + Assert.assertEquals(appGatewayId, actualRequest.getAppGatewayId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAppGatewayExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AppGateway appGateway = AppGateway.newBuilder().build(); + String appGatewayId = "appGatewayId355682654"; + client.createAppGatewayAsync(parent, appGateway, appGatewayId).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 createAppGatewayTest2() throws Exception { + AppGateway expectedResponse = + AppGateway.newBuilder() + .setName(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setUid("uid115792") + .setUri("uri116076") + .addAllAllocatedConnections(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAppGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppGatewaysService.addResponse(resultOperation); + + String parent = "parent-995424086"; + AppGateway appGateway = AppGateway.newBuilder().build(); + String appGatewayId = "appGatewayId355682654"; + + AppGateway actualResponse = + client.createAppGatewayAsync(parent, appGateway, appGatewayId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAppGatewayRequest actualRequest = ((CreateAppGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(appGateway, actualRequest.getAppGateway()); + Assert.assertEquals(appGatewayId, actualRequest.getAppGatewayId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAppGatewayExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + String parent = "parent-995424086"; + AppGateway appGateway = AppGateway.newBuilder().build(); + String appGatewayId = "appGatewayId355682654"; + client.createAppGatewayAsync(parent, appGateway, appGatewayId).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 deleteAppGatewayTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAppGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppGatewaysService.addResponse(resultOperation); + + AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]"); + + client.deleteAppGatewayAsync(name).get(); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppGatewayRequest actualRequest = ((DeleteAppGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppGatewayExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + AppGatewayName name = AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]"); + client.deleteAppGatewayAsync(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 deleteAppGatewayTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAppGatewayTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppGatewaysService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteAppGatewayAsync(name).get(); + + List actualRequests = mockAppGatewaysService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAppGatewayRequest actualRequest = ((DeleteAppGatewayRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAppGatewayExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppGatewaysService.addException(exception); + + try { + String name = "name3373707"; + client.deleteAppGatewayAsync(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 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(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").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(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").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(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").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(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").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(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").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(AppGatewayName.of("[PROJECT]", "[LOCATION]", "[APP_GATEWAY]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysService.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysService.java new file mode 100644 index 000000000000..01799e84ab06 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysService.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.beyondcorp.appgateways.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 MockAppGatewaysService implements MockGrpcService { + private final MockAppGatewaysServiceImpl serviceImpl; + + public MockAppGatewaysService() { + serviceImpl = new MockAppGatewaysServiceImpl(); + } + + @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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysServiceImpl.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysServiceImpl.java new file mode 100644 index 000000000000..010cedcc4aed --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockAppGatewaysServiceImpl.java @@ -0,0 +1,145 @@ +/* + * 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.beyondcorp.appgateways.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceGrpc.AppGatewaysServiceImplBase; +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 MockAppGatewaysServiceImpl extends AppGatewaysServiceImplBase { + private List requests; + private Queue responses; + + public MockAppGatewaysServiceImpl() { + 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 listAppGateways( + ListAppGatewaysRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAppGatewaysResponse) { + requests.add(request); + responseObserver.onNext(((ListAppGatewaysResponse) 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 ListAppGateways, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAppGatewaysResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAppGateway( + GetAppGatewayRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AppGateway) { + requests.add(request); + responseObserver.onNext(((AppGateway) 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 GetAppGateway, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AppGateway.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAppGateway( + CreateAppGatewayRequest 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 CreateAppGateway, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAppGateway( + DeleteAppGatewayRequest 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 DeleteAppGateway, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockIAMPolicy.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockIAMPolicy.java new file mode 100644 index 000000000000..869f3782966a --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/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.beyondcorp.appgateways.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 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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockIAMPolicyImpl.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..09a63dd14464 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/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.beyondcorp.appgateways.v1; + +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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockLocations.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockLocations.java new file mode 100644 index 000000000000..6fba7c98d6a2 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/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.beyondcorp.appgateways.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 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/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockLocationsImpl.java b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..b48d95adb871 --- /dev/null +++ b/java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/src/test/java/com/google/cloud/beyondcorp/appgateways/v1/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.beyondcorp.appgateways.v1; + +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/java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/pom.xml b/java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/pom.xml new file mode 100644 index 000000000000..efea65e82bbe --- /dev/null +++ b/java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-beyondcorp-appgateways-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-beyondcorp-appgateways-v1 + GRPC library for google-cloud-beyondcorp-appgateways + + com.google.cloud + google-cloud-beyondcorp-appgateways-parent + 0.0.1-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-beyondcorp-appgateways-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/java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceGrpc.java b/java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceGrpc.java new file mode 100644 index 000000000000..b08f6d96fffc --- /dev/null +++ b/java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceGrpc.java @@ -0,0 +1,764 @@ +/* + * 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.beyondcorp.appgateways.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * ## API Overview
+ * The `beyondcorp.googleapis.com` service implements the Google Cloud
+ * BeyondCorp API.
+ * ## Data Model
+ * The AppGatewaysService exposes the following resources:
+ * * AppGateways, named as follows:
+ *   `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`.
+ * The AppGatewaysService service provides methods to manage
+ * (create/read/update/delete) BeyondCorp AppGateways.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AppGatewaysServiceGrpc { + + private AppGatewaysServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.beyondcorp.appgateways.v1.AppGatewaysService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse> + getListAppGatewaysMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAppGateways", + requestType = com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.class, + responseType = com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse> + getListAppGatewaysMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse> + getListAppGatewaysMethod; + if ((getListAppGatewaysMethod = AppGatewaysServiceGrpc.getListAppGatewaysMethod) == null) { + synchronized (AppGatewaysServiceGrpc.class) { + if ((getListAppGatewaysMethod = AppGatewaysServiceGrpc.getListAppGatewaysMethod) == null) { + AppGatewaysServiceGrpc.getListAppGatewaysMethod = + getListAppGatewaysMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAppGateways")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AppGatewaysServiceMethodDescriptorSupplier("ListAppGateways")) + .build(); + } + } + } + return getListAppGatewaysMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway> + getGetAppGatewayMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAppGateway", + requestType = com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.class, + responseType = com.google.cloud.beyondcorp.appgateways.v1.AppGateway.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway> + getGetAppGatewayMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway> + getGetAppGatewayMethod; + if ((getGetAppGatewayMethod = AppGatewaysServiceGrpc.getGetAppGatewayMethod) == null) { + synchronized (AppGatewaysServiceGrpc.class) { + if ((getGetAppGatewayMethod = AppGatewaysServiceGrpc.getGetAppGatewayMethod) == null) { + AppGatewaysServiceGrpc.getGetAppGatewayMethod = + getGetAppGatewayMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAppGateway")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway + .getDefaultInstance())) + .setSchemaDescriptor( + new AppGatewaysServiceMethodDescriptorSupplier("GetAppGateway")) + .build(); + } + } + } + return getGetAppGatewayMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest, + com.google.longrunning.Operation> + getCreateAppGatewayMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAppGateway", + requestType = com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest, + com.google.longrunning.Operation> + getCreateAppGatewayMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest, + com.google.longrunning.Operation> + getCreateAppGatewayMethod; + if ((getCreateAppGatewayMethod = AppGatewaysServiceGrpc.getCreateAppGatewayMethod) == null) { + synchronized (AppGatewaysServiceGrpc.class) { + if ((getCreateAppGatewayMethod = AppGatewaysServiceGrpc.getCreateAppGatewayMethod) + == null) { + AppGatewaysServiceGrpc.getCreateAppGatewayMethod = + getCreateAppGatewayMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAppGateway")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AppGatewaysServiceMethodDescriptorSupplier("CreateAppGateway")) + .build(); + } + } + } + return getCreateAppGatewayMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest, + com.google.longrunning.Operation> + getDeleteAppGatewayMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAppGateway", + requestType = com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest, + com.google.longrunning.Operation> + getDeleteAppGatewayMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest, + com.google.longrunning.Operation> + getDeleteAppGatewayMethod; + if ((getDeleteAppGatewayMethod = AppGatewaysServiceGrpc.getDeleteAppGatewayMethod) == null) { + synchronized (AppGatewaysServiceGrpc.class) { + if ((getDeleteAppGatewayMethod = AppGatewaysServiceGrpc.getDeleteAppGatewayMethod) + == null) { + AppGatewaysServiceGrpc.getDeleteAppGatewayMethod = + getDeleteAppGatewayMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAppGateway")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AppGatewaysServiceMethodDescriptorSupplier("DeleteAppGateway")) + .build(); + } + } + } + return getDeleteAppGatewayMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AppGatewaysServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppGatewaysServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppGatewaysServiceStub(channel, callOptions); + } + }; + return AppGatewaysServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AppGatewaysServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppGatewaysServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppGatewaysServiceBlockingStub(channel, callOptions); + } + }; + return AppGatewaysServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AppGatewaysServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppGatewaysServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppGatewaysServiceFutureStub(channel, callOptions); + } + }; + return AppGatewaysServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppGatewaysService exposes the following resources:
+   * * AppGateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`.
+   * The AppGatewaysService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppGateways.
+   * 
+ */ + public abstract static class AppGatewaysServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists AppGateways in a given project and location.
+     * 
+ */ + public void listAppGateways( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAppGatewaysMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single AppGateway.
+     * 
+ */ + public void getAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAppGatewayMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new AppGateway in a given project and location.
+     * 
+ */ + public void createAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAppGatewayMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single AppGateway.
+     * 
+ */ + public void deleteAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAppGatewayMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListAppGatewaysMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse>( + this, METHODID_LIST_APP_GATEWAYS))) + .addMethod( + getGetAppGatewayMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway>( + this, METHODID_GET_APP_GATEWAY))) + .addMethod( + getCreateAppGatewayMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_APP_GATEWAY))) + .addMethod( + getDeleteAppGatewayMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_APP_GATEWAY))) + .build(); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppGatewaysService exposes the following resources:
+   * * AppGateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`.
+   * The AppGatewaysService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppGateways.
+   * 
+ */ + public static final class AppGatewaysServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AppGatewaysServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppGatewaysServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppGatewaysServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AppGateways in a given project and location.
+     * 
+ */ + public void listAppGateways( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAppGatewaysMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single AppGateway.
+     * 
+ */ + public void getAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAppGatewayMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new AppGateway in a given project and location.
+     * 
+ */ + public void createAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAppGatewayMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single AppGateway.
+     * 
+ */ + public void deleteAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAppGatewayMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppGatewaysService exposes the following resources:
+   * * AppGateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`.
+   * The AppGatewaysService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppGateways.
+   * 
+ */ + public static final class AppGatewaysServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AppGatewaysServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppGatewaysServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppGatewaysServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AppGateways in a given project and location.
+     * 
+ */ + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse listAppGateways( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAppGatewaysMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single AppGateway.
+     * 
+ */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAppGatewayMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new AppGateway in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAppGatewayMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single AppGateway.
+     * 
+ */ + public com.google.longrunning.Operation deleteAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAppGatewayMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * ## API Overview
+   * The `beyondcorp.googleapis.com` service implements the Google Cloud
+   * BeyondCorp API.
+   * ## Data Model
+   * The AppGatewaysService exposes the following resources:
+   * * AppGateways, named as follows:
+   *   `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`.
+   * The AppGatewaysService service provides methods to manage
+   * (create/read/update/delete) BeyondCorp AppGateways.
+   * 
+ */ + public static final class AppGatewaysServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AppGatewaysServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppGatewaysServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppGatewaysServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists AppGateways in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse> + listAppGateways(com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAppGatewaysMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single AppGateway.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway> + getAppGateway(com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAppGatewayMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new AppGateway in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAppGatewayMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single AppGateway.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAppGatewayMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_APP_GATEWAYS = 0; + private static final int METHODID_GET_APP_GATEWAY = 1; + private static final int METHODID_CREATE_APP_GATEWAY = 2; + private static final int METHODID_DELETE_APP_GATEWAY = 3; + + 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 AppGatewaysServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AppGatewaysServiceImplBase 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_APP_GATEWAYS: + serviceImpl.listAppGateways( + (com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse>) + responseObserver); + break; + case METHODID_GET_APP_GATEWAY: + serviceImpl.getAppGateway( + (com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_APP_GATEWAY: + serviceImpl.createAppGateway( + (com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_APP_GATEWAY: + serviceImpl.deleteAppGateway( + (com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) 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 AppGatewaysServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AppGatewaysServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AppGatewaysService"); + } + } + + private static final class AppGatewaysServiceFileDescriptorSupplier + extends AppGatewaysServiceBaseDescriptorSupplier { + AppGatewaysServiceFileDescriptorSupplier() {} + } + + private static final class AppGatewaysServiceMethodDescriptorSupplier + extends AppGatewaysServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AppGatewaysServiceMethodDescriptorSupplier(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 (AppGatewaysServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AppGatewaysServiceFileDescriptorSupplier()) + .addMethod(getListAppGatewaysMethod()) + .addMethod(getGetAppGatewayMethod()) + .addMethod(getCreateAppGatewayMethod()) + .addMethod(getDeleteAppGatewayMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-beyondcorp-appgateways/java.header b/java-beyondcorp-appgateways/java.header new file mode 100644 index 000000000000..d0970ba7d375 --- /dev/null +++ b/java-beyondcorp-appgateways/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|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\.$ +^ \*/$ diff --git a/java-beyondcorp-appgateways/license-checks.xml b/java-beyondcorp-appgateways/license-checks.xml new file mode 100644 index 000000000000..6597fced808e --- /dev/null +++ b/java-beyondcorp-appgateways/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/java-beyondcorp-appgateways/owlbot.py b/java-beyondcorp-appgateways/owlbot.py new file mode 100644 index 000000000000..77243461d730 --- /dev/null +++ b/java-beyondcorp-appgateways/owlbot.py @@ -0,0 +1,24 @@ +# Copyright 2021 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates() \ No newline at end of file diff --git a/java-beyondcorp-appgateways/pom.xml b/java-beyondcorp-appgateways/pom.xml new file mode 100644 index 000000000000..572798a046b2 --- /dev/null +++ b/java-beyondcorp-appgateways/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + com.google.cloud + google-cloud-beyondcorp-appgateways-parent + pom + 0.0.1-SNAPSHOT + Google BeyondCorp AppGateways Parent + https://github.com/googleapis/java-beyondcorp-appgateways + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 1.5.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + neenushaji + Neenu Shaji + neenushaji@google.com + Google LLC + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-beyondcorp-appgateways.git + scm:git:git@github.com:googleapis/java-beyondcorp-appgateways.git + https://github.com/googleapis/java-beyondcorp-appgateways + HEAD + + + https://github.com/googleapis/java-beyondcorp-appgateways/issues + GitHub Issues + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-beyondcorp-appgateways-parent + + + + + + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-beyondcorp-appgateways-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-beyondcorp-appgateways-v1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 2.13.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-beyondcorp-appgateways + grpc-google-cloud-beyondcorp-appgateways-v1 + proto-google-cloud-beyondcorp-appgateways-v1 + google-cloud-beyondcorp-appgateways-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.3.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/clirr-ignored-differences.xml b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..230c59741299 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/beyondcorp/appgateways/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/beyondcorp/appgateways/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/beyondcorp/appgateways/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/pom.xml b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/pom.xml new file mode 100644 index 000000000000..284f5f34925b --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-beyondcorp-appgateways-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-beyondcorp-appgateways-v1 + Proto library for google-cloud-beyondcorp-appgateways + + com.google.cloud + google-cloud-beyondcorp-appgateways-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGateway.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGateway.java new file mode 100644 index 000000000000..e8618b88f227 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGateway.java @@ -0,0 +1,4497 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * A BeyondCorp AppGateway resource represents a BeyondCorp protected AppGateway
+ * to a remote application. It creates all the necessary GCP components needed
+ * for creating a BeyondCorp protected AppGateway. Multiple connectors can be
+ * authorised for a single AppGateway.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.AppGateway} + */ +public final class AppGateway extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.AppGateway) + AppGatewayOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppGateway.newBuilder() to construct. + private AppGateway(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppGateway() { + name_ = ""; + displayName_ = ""; + uid_ = ""; + type_ = 0; + state_ = 0; + uri_ = ""; + allocatedConnections_ = java.util.Collections.emptyList(); + hostType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AppGateway(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AppGateway( + 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: + { + 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 26: + { + 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 34: + { + 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 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + uid_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 64: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + allocatedConnections_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway + .AllocatedConnection>(); + mutable_bitField0_ |= 0x00000002; + } + allocatedConnections_.add( + input.readMessage( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + .parser(), + extensionRegistry)); + break; + } + case 88: + { + int rawValue = input.readEnum(); + + hostType_ = rawValue; + 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)) { + allocatedConnections_ = java.util.Collections.unmodifiableList(allocatedConnections_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.class, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder.class); + } + + /** + * + * + *
+   * Enum containing list of all possible network connectivity options
+   * supported by BeyondCorp AppGateway.
+   * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.appgateways.v1.AppGateway.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * TCP Proxy based BeyondCorp Connection. API will default to this if unset.
+     * 
+ * + * TCP_PROXY = 1; + */ + TCP_PROXY(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * TCP Proxy based BeyondCorp Connection. API will default to this if unset.
+     * 
+ * + * TCP_PROXY = 1; + */ + public static final int TCP_PROXY_VALUE = 1; + + 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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return TCP_PROXY; + 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 Type findValueByNumber(int number) { + return Type.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.beyondcorp.appgateways.v1.AppGateway.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway.Type) + } + + /** + * + * + *
+   * Represents the different states of an AppGateway.
+   * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.appgateways.v1.AppGateway.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * AppGateway is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * AppGateway has been created.
+     * 
+ * + * CREATED = 2; + */ + CREATED(2), + /** + * + * + *
+     * AppGateway's configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * AppGateway is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * AppGateway is down and may be restored in the future.
+     * This happens when CCFE sends ProjectState = OFF.
+     * 
+ * + * DOWN = 5; + */ + DOWN(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * AppGateway is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * AppGateway has been created.
+     * 
+ * + * CREATED = 2; + */ + public static final int CREATED_VALUE = 2; + /** + * + * + *
+     * AppGateway's configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * AppGateway is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * AppGateway is down and may be restored in the future.
+     * This happens when CCFE sends ProjectState = OFF.
+     * 
+ * + * DOWN = 5; + */ + public static final int DOWN_VALUE = 5; + + 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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return CREATED; + case 3: + return UPDATING; + case 4: + return DELETING; + case 5: + return DOWN; + 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 State findValueByNumber(int number) { + return State.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.beyondcorp.appgateways.v1.AppGateway.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway.State) + } + + /** + * + * + *
+   * Enum containing list of all possible host types supported by BeyondCorp
+   * Connection.
+   * 
+ * + * Protobuf enum {@code google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType} + */ + public enum HostType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * HOST_TYPE_UNSPECIFIED = 0; + */ + HOST_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * AppGateway hosted in a GCP regional managed instance group.
+     * 
+ * + * GCP_REGIONAL_MIG = 1; + */ + GCP_REGIONAL_MIG(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * HOST_TYPE_UNSPECIFIED = 0; + */ + public static final int HOST_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * AppGateway hosted in a GCP regional managed instance group.
+     * 
+ * + * GCP_REGIONAL_MIG = 1; + */ + public static final int GCP_REGIONAL_MIG_VALUE = 1; + + 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 HostType 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 HostType forNumber(int value) { + switch (value) { + case 0: + return HOST_TYPE_UNSPECIFIED; + case 1: + return GCP_REGIONAL_MIG; + 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 HostType findValueByNumber(int number) { + return HostType.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.beyondcorp.appgateways.v1.AppGateway.getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final HostType[] VALUES = values(); + + public static HostType 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 HostType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType) + } + + public interface AllocatedConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The PSC uri of an allocated connection
+     * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pscUri. + */ + java.lang.String getPscUri(); + /** + * + * + *
+     * Required. The PSC uri of an allocated connection
+     * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for pscUri. + */ + com.google.protobuf.ByteString getPscUriBytes(); + + /** + * + * + *
+     * Required. The ingress port of an allocated connection
+     * 
+ * + * int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The ingressPort. + */ + int getIngressPort(); + } + /** + * + * + *
+   * Allocated connection of the AppGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection} + */ + public static final class AllocatedConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) + AllocatedConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AllocatedConnection.newBuilder() to construct. + private AllocatedConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AllocatedConnection() { + pscUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AllocatedConnection(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AllocatedConnection( + 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(); + + pscUri_ = s; + break; + } + case 16: + { + ingressPort_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.class, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + .class); + } + + public static final int PSC_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object pscUri_; + /** + * + * + *
+     * Required. The PSC uri of an allocated connection
+     * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pscUri. + */ + @java.lang.Override + public java.lang.String getPscUri() { + java.lang.Object ref = pscUri_; + 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(); + pscUri_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The PSC uri of an allocated connection
+     * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for pscUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscUriBytes() { + java.lang.Object ref = pscUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INGRESS_PORT_FIELD_NUMBER = 2; + private int ingressPort_; + /** + * + * + *
+     * Required. The ingress port of an allocated connection
+     * 
+ * + * int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The ingressPort. + */ + @java.lang.Override + public int getIngressPort() { + return ingressPort_; + } + + 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(pscUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscUri_); + } + if (ingressPort_ != 0) { + output.writeInt32(2, ingressPort_); + } + 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(pscUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pscUri_); + } + if (ingressPort_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, ingressPort_); + } + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection other = + (com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) obj; + + if (!getPscUri().equals(other.getPscUri())) return false; + if (getIngressPort() != other.getIngressPort()) 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) + PSC_URI_FIELD_NUMBER; + hash = (53 * hash) + getPscUri().hashCode(); + hash = (37 * hash) + INGRESS_PORT_FIELD_NUMBER; + hash = (53 * hash) + getIngressPort(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection 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; + } + /** + * + * + *
+     * Allocated connection of the AppGateway.
+     * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.class, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + .class); + } + + // Construct using + // com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.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(); + pscUri_ = ""; + + ingressPort_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection build() { + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection result = + new com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection(this); + result.pscUri_ = pscUri_; + result.ingressPort_ = ingressPort_; + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) { + return mergeFrom( + (com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + .getDefaultInstance()) return this; + if (!other.getPscUri().isEmpty()) { + pscUri_ = other.pscUri_; + onChanged(); + } + if (other.getIngressPort() != 0) { + setIngressPort(other.getIngressPort()); + } + 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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object pscUri_ = ""; + /** + * + * + *
+       * Required. The PSC uri of an allocated connection
+       * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pscUri. + */ + public java.lang.String getPscUri() { + java.lang.Object ref = pscUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The PSC uri of an allocated connection
+       * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for pscUri. + */ + public com.google.protobuf.ByteString getPscUriBytes() { + java.lang.Object ref = pscUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The PSC uri of an allocated connection
+       * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The pscUri to set. + * @return This builder for chaining. + */ + public Builder setPscUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pscUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The PSC uri of an allocated connection
+       * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPscUri() { + + pscUri_ = getDefaultInstance().getPscUri(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The PSC uri of an allocated connection
+       * 
+ * + * string psc_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for pscUri to set. + * @return This builder for chaining. + */ + public Builder setPscUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pscUri_ = value; + onChanged(); + return this; + } + + private int ingressPort_; + /** + * + * + *
+       * Required. The ingress port of an allocated connection
+       * 
+ * + * int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The ingressPort. + */ + @java.lang.Override + public int getIngressPort() { + return ingressPort_; + } + /** + * + * + *
+       * Required. The ingress port of an allocated connection
+       * 
+ * + * int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The ingressPort to set. + * @return This builder for chaining. + */ + public Builder setIngressPort(int value) { + + ingressPort_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ingress port of an allocated connection
+       * 
+ * + * int32 ingress_port = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearIngressPort() { + + ingressPort_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection) + private static final com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocatedConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllocatedConnection(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.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Unique resource name of the AppGateway.
+   * The name is ignored when creating an AppGateway.
+   * 
+ * + * 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. Unique resource name of the AppGateway.
+   * The name is ignored when creating an AppGateway.
+   * 
+ * + * 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 CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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 = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_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. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.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 DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+   * 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+   * 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 6; + private volatile java.lang.Object uid_; + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 7; + private int type_; + /** + * + * + *
+   * Required. The type of network connectivity used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Required. The type of network connectivity used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type result = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type.valueOf(type_); + return result == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type.UNRECOGNIZED + : result; + } + + public static final int STATE_FIELD_NUMBER = 8; + private int state_; + /** + * + * + *
+   * Output only. The current state of the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current state of the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State result = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State.valueOf(state_); + return result == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State.UNRECOGNIZED + : result; + } + + public static final int URI_FIELD_NUMBER = 9; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Output only. Server-defined URI for this resource.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined URI for this resource.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATED_CONNECTIONS_FIELD_NUMBER = 10; + private java.util.List + allocatedConnections_; + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getAllocatedConnectionsList() { + return allocatedConnections_; + } + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder> + getAllocatedConnectionsOrBuilderList() { + return allocatedConnections_; + } + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getAllocatedConnectionsCount() { + return allocatedConnections_.size(); + } + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + getAllocatedConnections(int index) { + return allocatedConnections_.get(index); + } + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder + getAllocatedConnectionsOrBuilder(int index) { + return allocatedConnections_.get(index); + } + + public static final int HOST_TYPE_FIELD_NUMBER = 11; + private int hostType_; + /** + * + * + *
+   * Required. The type of hosting used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for hostType. + */ + @java.lang.Override + public int getHostTypeValue() { + return hostType_; + } + /** + * + * + *
+   * Required. The type of hosting used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostType. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType getHostType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType result = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType.valueOf(hostType_); + return result == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType.UNRECOGNIZED + : result; + } + + 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 (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, uid_); + } + if (type_ + != com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, type_); + } + if (state_ + != com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, uri_); + } + for (int i = 0; i < allocatedConnections_.size(); i++) { + output.writeMessage(10, allocatedConnections_.get(i)); + } + if (hostType_ + != com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType.HOST_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, hostType_); + } + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, 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(4, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, uid_); + } + if (type_ + != com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, type_); + } + if (state_ + != com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, uri_); + } + for (int i = 0; i < allocatedConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, allocatedConnections_.get(i)); + } + if (hostType_ + != com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType.HOST_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, hostType_); + } + 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.beyondcorp.appgateways.v1.AppGateway)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.AppGateway other = + (com.google.cloud.beyondcorp.appgateways.v1.AppGateway) obj; + + if (!getName().equals(other.getName())) 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 (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (type_ != other.type_) return false; + if (state_ != other.state_) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getAllocatedConnectionsList().equals(other.getAllocatedConnectionsList())) return false; + if (hostType_ != other.hostType_) 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(); + 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getAllocatedConnectionsCount() > 0) { + hash = (37 * hash) + ALLOCATED_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getAllocatedConnectionsList().hashCode(); + } + hash = (37 * hash) + HOST_TYPE_FIELD_NUMBER; + hash = (53 * hash) + hostType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway 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.beyondcorp.appgateways.v1.AppGateway parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway 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.beyondcorp.appgateways.v1.AppGateway parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway 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.beyondcorp.appgateways.v1.AppGateway parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway 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.beyondcorp.appgateways.v1.AppGateway parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway 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.beyondcorp.appgateways.v1.AppGateway prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A BeyondCorp AppGateway resource represents a BeyondCorp protected AppGateway
+   * to a remote application. It creates all the necessary GCP components needed
+   * for creating a BeyondCorp protected AppGateway. Multiple connectors can be
+   * authorised for a single AppGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.AppGateway} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.AppGateway) + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.class, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder.class); + } + + // Construct using com.google.cloud.beyondcorp.appgateways.v1.AppGateway.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAllocatedConnectionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + displayName_ = ""; + + uid_ = ""; + + type_ = 0; + + state_ = 0; + + uri_ = ""; + + if (allocatedConnectionsBuilder_ == null) { + allocatedConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + allocatedConnectionsBuilder_.clear(); + } + hostType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway build() { + com.google.cloud.beyondcorp.appgateways.v1.AppGateway result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.AppGateway result = + new com.google.cloud.beyondcorp.appgateways.v1.AppGateway(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + 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.displayName_ = displayName_; + result.uid_ = uid_; + result.type_ = type_; + result.state_ = state_; + result.uri_ = uri_; + if (allocatedConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + allocatedConnections_ = java.util.Collections.unmodifiableList(allocatedConnections_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.allocatedConnections_ = allocatedConnections_; + } else { + result.allocatedConnections_ = allocatedConnectionsBuilder_.build(); + } + result.hostType_ = hostType_; + 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.beyondcorp.appgateways.v1.AppGateway) { + return mergeFrom((com.google.cloud.beyondcorp.appgateways.v1.AppGateway) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.beyondcorp.appgateways.v1.AppGateway other) { + if (other == com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (allocatedConnectionsBuilder_ == null) { + if (!other.allocatedConnections_.isEmpty()) { + if (allocatedConnections_.isEmpty()) { + allocatedConnections_ = other.allocatedConnections_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.addAll(other.allocatedConnections_); + } + onChanged(); + } + } else { + if (!other.allocatedConnections_.isEmpty()) { + if (allocatedConnectionsBuilder_.isEmpty()) { + allocatedConnectionsBuilder_.dispose(); + allocatedConnectionsBuilder_ = null; + allocatedConnections_ = other.allocatedConnections_; + bitField0_ = (bitField0_ & ~0x00000002); + allocatedConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAllocatedConnectionsFieldBuilder() + : null; + } else { + allocatedConnectionsBuilder_.addAllMessages(other.allocatedConnections_); + } + } + } + if (other.hostType_ != 0) { + setHostTypeValue(other.getHostTypeValue()); + } + 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.beyondcorp.appgateways.v1.AppGateway parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.AppGateway) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Unique resource name of the AppGateway.
+     * The name is ignored when creating an AppGateway.
+     * 
+ * + * 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. Unique resource name of the AppGateway.
+     * The name is ignored when creating an AppGateway.
+     * 
+ * + * 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. Unique resource name of the AppGateway.
+     * The name is ignored when creating an AppGateway.
+     * 
+ * + * 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. Unique resource name of the AppGateway.
+     * The name is ignored when creating an AppGateway.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique resource name of the AppGateway.
+     * The name is ignored when creating an AppGateway.
+     * 
+ * + * 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 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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the resource was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + 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. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.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. Resource labels to represent user provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+     * 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+     * 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+     * 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+     * 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+     * 64 characters.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + + uid_ = getDefaultInstance().getUid(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A unique identifier for the instance generated by the
+     * system.
+     * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uid_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Required. The type of network connectivity used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type getType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type result = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type.valueOf(type_); + return result == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of network connectivity used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current state of the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State result = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State.valueOf(state_); + return result == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current state of the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined URI for this resource.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection> + allocatedConnections_ = java.util.Collections.emptyList(); + + private void ensureAllocatedConnectionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + allocatedConnections_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection>( + allocatedConnections_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder> + allocatedConnectionsBuilder_; + + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getAllocatedConnectionsList() { + if (allocatedConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(allocatedConnections_); + } else { + return allocatedConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getAllocatedConnectionsCount() { + if (allocatedConnectionsBuilder_ == null) { + return allocatedConnections_.size(); + } else { + return allocatedConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + getAllocatedConnections(int index) { + if (allocatedConnectionsBuilder_ == null) { + return allocatedConnections_.get(index); + } else { + return allocatedConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAllocatedConnections( + int index, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection value) { + if (allocatedConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.set(index, value); + onChanged(); + } else { + allocatedConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAllocatedConnections( + int index, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + builderForValue) { + if (allocatedConnectionsBuilder_ == null) { + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + allocatedConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllocatedConnections( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection value) { + if (allocatedConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.add(value); + onChanged(); + } else { + allocatedConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllocatedConnections( + int index, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection value) { + if (allocatedConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.add(index, value); + onChanged(); + } else { + allocatedConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllocatedConnections( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + builderForValue) { + if (allocatedConnectionsBuilder_ == null) { + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.add(builderForValue.build()); + onChanged(); + } else { + allocatedConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllocatedConnections( + int index, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + builderForValue) { + if (allocatedConnectionsBuilder_ == null) { + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + allocatedConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllAllocatedConnections( + java.lang.Iterable< + ? extends com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection> + values) { + if (allocatedConnectionsBuilder_ == null) { + ensureAllocatedConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allocatedConnections_); + onChanged(); + } else { + allocatedConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAllocatedConnections() { + if (allocatedConnectionsBuilder_ == null) { + allocatedConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + allocatedConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeAllocatedConnections(int index) { + if (allocatedConnectionsBuilder_ == null) { + ensureAllocatedConnectionsIsMutable(); + allocatedConnections_.remove(index); + onChanged(); + } else { + allocatedConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + getAllocatedConnectionsBuilder(int index) { + return getAllocatedConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder + getAllocatedConnectionsOrBuilder(int index) { + if (allocatedConnectionsBuilder_ == null) { + return allocatedConnections_.get(index); + } else { + return allocatedConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder> + getAllocatedConnectionsOrBuilderList() { + if (allocatedConnectionsBuilder_ != null) { + return allocatedConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(allocatedConnections_); + } + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + addAllocatedConnectionsBuilder() { + return getAllocatedConnectionsFieldBuilder() + .addBuilder( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder + addAllocatedConnectionsBuilder(int index) { + return getAllocatedConnectionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection + .getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of connections allocated for the Gateway
+     * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder> + getAllocatedConnectionsBuilderList() { + return getAllocatedConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder> + getAllocatedConnectionsFieldBuilder() { + if (allocatedConnectionsBuilder_ == null) { + allocatedConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder>( + allocatedConnections_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + allocatedConnections_ = null; + } + return allocatedConnectionsBuilder_; + } + + private int hostType_ = 0; + /** + * + * + *
+     * Required. The type of hosting used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for hostType. + */ + @java.lang.Override + public int getHostTypeValue() { + return hostType_; + } + /** + * + * + *
+     * Required. The type of hosting used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for hostType to set. + * @return This builder for chaining. + */ + public Builder setHostTypeValue(int value) { + + hostType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of hosting used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostType. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType getHostType() { + @SuppressWarnings("deprecation") + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType result = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType.valueOf(hostType_); + return result == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of hosting used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The hostType to set. + * @return This builder for chaining. + */ + public Builder setHostType( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType value) { + if (value == null) { + throw new NullPointerException(); + } + + hostType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of hosting used by the AppGateway.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearHostType() { + + hostType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.AppGateway) + private static final com.google.cloud.beyondcorp.appgateways.v1.AppGateway DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.AppGateway(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGateway getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppGateway parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppGateway(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.beyondcorp.appgateways.v1.AppGateway getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayName.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayName.java new file mode 100644 index 000000000000..619fb374d49c --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayName.java @@ -0,0 +1,223 @@ +/* + * 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.beyondcorp.appgateways.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 AppGatewayName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_APP_GATEWAY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/appGateways/{app_gateway}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String appGateway; + + @Deprecated + protected AppGatewayName() { + project = null; + location = null; + appGateway = null; + } + + private AppGatewayName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + appGateway = Preconditions.checkNotNull(builder.getAppGateway()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAppGateway() { + return appGateway; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AppGatewayName of(String project, String location, String appGateway) { + return newBuilder().setProject(project).setLocation(location).setAppGateway(appGateway).build(); + } + + public static String format(String project, String location, String appGateway) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAppGateway(appGateway) + .build() + .toString(); + } + + public static AppGatewayName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_APP_GATEWAY.validatedMatch( + formattedString, "AppGatewayName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("app_gateway")); + } + + 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 (AppGatewayName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_APP_GATEWAY.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 (appGateway != null) { + fieldMapBuilder.put("app_gateway", appGateway); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_APP_GATEWAY.instantiate( + "project", project, "location", location, "app_gateway", appGateway); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AppGatewayName that = ((AppGatewayName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.appGateway, that.appGateway); + } + 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(appGateway); + return h; + } + + /** Builder for projects/{project}/locations/{location}/appGateways/{app_gateway}. */ + public static class Builder { + private String project; + private String location; + private String appGateway; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAppGateway() { + return appGateway; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAppGateway(String appGateway) { + this.appGateway = appGateway; + return this; + } + + private Builder(AppGatewayName appGatewayName) { + this.project = appGatewayName.project; + this.location = appGatewayName.location; + this.appGateway = appGatewayName.appGateway; + } + + public AppGatewayName build() { + return new AppGatewayName(this); + } + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadata.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadata.java new file mode 100644 index 000000000000..c8d78e886e09 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadata.java @@ -0,0 +1,1867 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata} + */ +public final class AppGatewayOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) + AppGatewayOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AppGatewayOperationMetadata.newBuilder() to construct. + private AppGatewayOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AppGatewayOperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AppGatewayOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AppGatewayOperationMetadata( + 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata.class, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata.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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata other = + (com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata.class, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata.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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata build() { + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata result = + new com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata(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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) { + return mergeFrom( + (com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + .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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) + 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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) + private static final com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppGatewayOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppGatewayOperationMetadata(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.beyondcorp.appgateways.v1.AppGatewayOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadataOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..94234c6e5e7c --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface AppGatewayOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata) + 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/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOrBuilder.java new file mode 100644 index 000000000000..6eb57cb816e5 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewayOrBuilder.java @@ -0,0 +1,420 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface AppGatewayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.AppGateway) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Unique resource name of the AppGateway.
+   * The name is ignored when creating an AppGateway.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Unique resource name of the AppGateway.
+   * The name is ignored when creating an AppGateway.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the resource was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Resource labels to represent user provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+   * 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed
+   * 64 characters.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. A unique identifier for the instance generated by the
+   * system.
+   * 
+ * + * string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Required. The type of network connectivity used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Required. The type of network connectivity used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.Type type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The type. + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Type getType(); + + /** + * + * + *
+   * Output only. The current state of the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.State getState(); + + /** + * + * + *
+   * Output only. Server-defined URI for this resource.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Output only. Server-defined URI for this resource.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getAllocatedConnectionsList(); + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection getAllocatedConnections( + int index); + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getAllocatedConnectionsCount(); + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List< + ? extends + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder> + getAllocatedConnectionsOrBuilderList(); + /** + * + * + *
+   * Output only. A list of connections allocated for the Gateway
+   * 
+ * + * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnection allocated_connections = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.AllocatedConnectionOrBuilder + getAllocatedConnectionsOrBuilder(int index); + + /** + * + * + *
+   * Required. The type of hosting used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for hostType. + */ + int getHostTypeValue(); + /** + * + * + *
+   * Required. The type of hosting used by the AppGateway.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType host_type = 11 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hostType. + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.HostType getHostType(); +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceProto.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceProto.java new file mode 100644 index 000000000000..9eb754b139ce --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/AppGatewaysServiceProto.java @@ -0,0 +1,294 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public final class AppGatewaysServiceProto { + private AppGatewaysServiceProto() {} + + 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_beyondcorp_appgateways_v1_ListAppGatewaysRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nAgoogle/cloud/beyondcorp/appgateways/v1" + + "/app_gateways_service.proto\022&google.clou" + + "d.beyondcorp.appgateways.v1\032\034google/api/" + + "annotations.proto\032\027google/api/client.pro" + + "to\032\037google/api/field_behavior.proto\032\031goo" + + "gle/api/resource.proto\032#google/longrunni" + + "ng/operations.proto\032\037google/protobuf/tim" + + "estamp.proto\"\263\001\n\026ListAppGatewaysRequest\022" + + "<\n\006parent\030\001 \001(\tB,\340A\002\372A&\022$beyondcorp.goog" + + "leapis.com/AppGateway\022\026\n\tpage_size\030\002 \001(\005" + + "B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter" + + "\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\221\001\n\027L" + + "istAppGatewaysResponse\022H\n\014app_gateways\030\001" + + " \003(\01322.google.cloud.beyondcorp.appgatewa" + + "ys.v1.AppGateway\022\027\n\017next_page_token\030\002 \001(" + + "\t\022\023\n\013unreachable\030\003 \003(\t\"R\n\024GetAppGatewayR" + + "equest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$beyondcorp" + + ".googleapis.com/AppGateway\"\367\001\n\027CreateApp" + + "GatewayRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\022$" + + "beyondcorp.googleapis.com/AppGateway\022\033\n\016" + + "app_gateway_id\030\002 \001(\tB\003\340A\001\022L\n\013app_gateway" + + "\030\003 \001(\01322.google.cloud.beyondcorp.appgate" + + "ways.v1.AppGatewayB\003\340A\002\022\027\n\nrequest_id\030\004 " + + "\001(\tB\003\340A\001\022\032\n\rvalidate_only\030\005 \001(\010B\003\340A\001\"\212\001\n" + + "\027DeleteAppGatewayRequest\022:\n\004name\030\001 \001(\tB," + + "\340A\002\372A&\n$beyondcorp.googleapis.com/AppGat" + + "eway\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\022\032\n\rvalidat" + + "e_only\030\003 \001(\010B\003\340A\001\"\252\010\n\nAppGateway\022\021\n\004name" + + "\030\001 \001(\tB\003\340A\002\0224\n\013create_time\030\002 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\0224\n\013update_time" + + "\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022" + + "S\n\006labels\030\004 \003(\0132>.google.cloud.beyondcor" + + "p.appgateways.v1.AppGateway.LabelsEntryB" + + "\003\340A\001\022\031\n\014display_name\030\005 \001(\tB\003\340A\001\022\020\n\003uid\030\006" + + " \001(\tB\003\340A\003\022J\n\004type\030\007 \001(\01627.google.cloud.b" + + "eyondcorp.appgateways.v1.AppGateway.Type" + + "B\003\340A\002\022L\n\005state\030\010 \001(\01628.google.cloud.beyo" + + "ndcorp.appgateways.v1.AppGateway.StateB\003" + + "\340A\003\022\020\n\003uri\030\t \001(\tB\003\340A\003\022j\n\025allocated_conne" + + "ctions\030\n \003(\0132F.google.cloud.beyondcorp.a" + + "ppgateways.v1.AppGateway.AllocatedConnec" + + "tionB\003\340A\003\022S\n\thost_type\030\013 \001(\0162;.google.cl" + + "oud.beyondcorp.appgateways.v1.AppGateway" + + ".HostTypeB\003\340A\002\032F\n\023AllocatedConnection\022\024\n" + + "\007psc_uri\030\001 \001(\tB\003\340A\002\022\031\n\014ingress_port\030\002 \001(" + + "\005B\003\340A\002\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"+\n\004Type\022\024\n\020TYPE_UNSPECIFIE" + + "D\020\000\022\r\n\tTCP_PROXY\020\001\"_\n\005State\022\025\n\021STATE_UNS" + + "PECIFIED\020\000\022\014\n\010CREATING\020\001\022\013\n\007CREATED\020\002\022\014\n" + + "\010UPDATING\020\003\022\014\n\010DELETING\020\004\022\010\n\004DOWN\020\005\";\n\010H" + + "ostType\022\031\n\025HOST_TYPE_UNSPECIFIED\020\000\022\024\n\020GC" + + "P_REGIONAL_MIG\020\001:l\352Ai\n$beyondcorp.google" + + "apis.com/AppGateway\022Aprojects/{project}/" + + "locations/{location}/appGateways/{app_ga" + + "teway}\"\212\002\n\033AppGatewayOperationMetadata\0224" + + "\n\013create_time\030\001 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB" + + "\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status_messag" + + "e\030\005 \001(\tB\003\340A\003\022#\n\026requested_cancellation\030\006" + + " \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\0032\366\007\n\022" + + "AppGatewaysService\022\324\001\n\017ListAppGateways\022>" + + ".google.cloud.beyondcorp.appgateways.v1." + + "ListAppGatewaysRequest\032?.google.cloud.be" + + "yondcorp.appgateways.v1.ListAppGatewaysR" + + "esponse\"@\202\323\344\223\0021\022//v1/{parent=projects/*/" + + "locations/*}/appGateways\332A\006parent\022\301\001\n\rGe" + + "tAppGateway\022<.google.cloud.beyondcorp.ap" + + "pgateways.v1.GetAppGatewayRequest\0322.goog" + + "le.cloud.beyondcorp.appgateways.v1.AppGa" + + "teway\">\202\323\344\223\0021\022//v1/{name=projects/*/loca" + + "tions/*/appGateways/*}\332A\004name\022\211\002\n\020Create" + + "AppGateway\022?.google.cloud.beyondcorp.app" + + "gateways.v1.CreateAppGatewayRequest\032\035.go" + + "ogle.longrunning.Operation\"\224\001\202\323\344\223\002>\"//v1" + + "/{parent=projects/*/locations/*}/appGate" + + "ways:\013app_gateway\332A!parent,app_gateway,a" + + "pp_gateway_id\312A)\n\nAppGateway\022\033AppGateway" + + "OperationMetadata\022\351\001\n\020DeleteAppGateway\022?" + + ".google.cloud.beyondcorp.appgateways.v1." + + "DeleteAppGatewayRequest\032\035.google.longrun" + + "ning.Operation\"u\202\323\344\223\0021*//v1/{name=projec" + + "ts/*/locations/*/appGateways/*}\332A\004name\312A" + + "4\n\025google.protobuf.Empty\022\033AppGatewayOper" + + "ationMetadata\032M\312A\031beyondcorp.googleapis." + + "com\322A.https://www.googleapis.com/auth/cl" + + "oud-platformB\231\002\n*com.google.cloud.beyond" + + "corp.appgateways.v1B\027AppGatewaysServiceP" + + "rotoP\001ZQgoogle.golang.org/genproto/googl" + + "eapis/cloud/beyondcorp/appgateways/v1;ap" + + "pgateways\252\002&Google.Cloud.BeyondCorp.AppG" + + "ateways.V1\312\002&Google\\Cloud\\BeyondCorp\\App" + + "Gateways\\V1\352\002*Google::Cloud::BeyondCorp:" + + ":AppGateways::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.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_descriptor, + new java.lang.String[] { + "AppGateways", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_descriptor, + new java.lang.String[] { + "Parent", "AppGatewayId", "AppGateway", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", "ValidateOnly", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "DisplayName", + "Uid", + "Type", + "State", + "Uri", + "AllocatedConnections", + "HostType", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_descriptor = + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_AllocatedConnection_descriptor, + new java.lang.String[] { + "PscUri", "IngressPort", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_LabelsEntry_descriptor = + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGateway_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_beyondcorp_appgateways_v1_AppGatewayOperationMetadata_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.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequest.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequest.java new file mode 100644 index 000000000000..02e50a49a63f --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequest.java @@ -0,0 +1,1517 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.CreateAppGateway.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest} + */ +public final class CreateAppGatewayRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) + CreateAppGatewayRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAppGatewayRequest.newBuilder() to construct. + private CreateAppGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAppGatewayRequest() { + parent_ = ""; + appGatewayId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAppGatewayRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAppGatewayRequest( + 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(); + + appGatewayId_ = s; + break; + } + case 26: + { + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder subBuilder = null; + if (appGateway_ != null) { + subBuilder = appGateway_.toBuilder(); + } + appGateway_ = + input.readMessage( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(appGateway_); + appGateway_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 40: + { + validateOnly_ = input.readBool(); + 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource project name of the AppGateway location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * 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 resource project name of the AppGateway location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * 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 APP_GATEWAY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appGatewayId_; + /** + * + * + *
+   * Optional. User-settable AppGateway resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appGatewayId. + */ + @java.lang.Override + public java.lang.String getAppGatewayId() { + java.lang.Object ref = appGatewayId_; + 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(); + appGatewayId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User-settable AppGateway resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appGatewayId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppGatewayIdBytes() { + java.lang.Object ref = appGatewayId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appGatewayId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_GATEWAY_FIELD_NUMBER = 3; + private com.google.cloud.beyondcorp.appgateways.v1.AppGateway appGateway_; + /** + * + * + *
+   * Required. A BeyondCorp AppGateway resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appGateway field is set. + */ + @java.lang.Override + public boolean hasAppGateway() { + return appGateway_ != null; + } + /** + * + * + *
+   * Required. A BeyondCorp AppGateway resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appGateway. + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateway() { + return appGateway_ == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance() + : appGateway_; + } + /** + * + * + *
+   * Required. A BeyondCorp AppGateway resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder getAppGatewayOrBuilder() { + return getAppGateway(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(appGatewayId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appGatewayId_); + } + if (appGateway_ != null) { + output.writeMessage(3, getAppGateway()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + 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(appGatewayId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appGatewayId_); + } + if (appGateway_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAppGateway()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, validateOnly_); + } + 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest other = + (com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAppGatewayId().equals(other.getAppGatewayId())) return false; + if (hasAppGateway() != other.hasAppGateway()) return false; + if (hasAppGateway()) { + if (!getAppGateway().equals(other.getAppGateway())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + APP_GATEWAY_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppGatewayId().hashCode(); + if (hasAppGateway()) { + hash = (37 * hash) + APP_GATEWAY_FIELD_NUMBER; + hash = (53 * hash) + getAppGateway().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.CreateAppGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest.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_ = ""; + + appGatewayId_ = ""; + + if (appGatewayBuilder_ == null) { + appGateway_ = null; + } else { + appGateway_ = null; + appGatewayBuilder_ = null; + } + requestId_ = ""; + + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_CreateAppGatewayRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest build() { + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest result = + new com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest(this); + result.parent_ = parent_; + result.appGatewayId_ = appGatewayId_; + if (appGatewayBuilder_ == null) { + result.appGateway_ = appGateway_; + } else { + result.appGateway_ = appGatewayBuilder_.build(); + } + result.requestId_ = requestId_; + result.validateOnly_ = validateOnly_; + 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getAppGatewayId().isEmpty()) { + appGatewayId_ = other.appGatewayId_; + onChanged(); + } + if (other.hasAppGateway()) { + mergeAppGateway(other.getAppGateway()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource project name of the AppGateway location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource project name of the AppGateway location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource project name of the AppGateway location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource project name of the AppGateway location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource project name of the AppGateway location using the
+     * form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 appGatewayId_ = ""; + /** + * + * + *
+     * Optional. User-settable AppGateway resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appGatewayId. + */ + public java.lang.String getAppGatewayId() { + java.lang.Object ref = appGatewayId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appGatewayId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User-settable AppGateway resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appGatewayId. + */ + public com.google.protobuf.ByteString getAppGatewayIdBytes() { + java.lang.Object ref = appGatewayId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appGatewayId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User-settable AppGateway resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The appGatewayId to set. + * @return This builder for chaining. + */ + public Builder setAppGatewayId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appGatewayId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-settable AppGateway resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAppGatewayId() { + + appGatewayId_ = getDefaultInstance().getAppGatewayId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-settable AppGateway resource ID.
+     *  * Must start with a letter.
+     *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+     *  * Must end with a number or a letter.
+     * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for appGatewayId to set. + * @return This builder for chaining. + */ + public Builder setAppGatewayIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appGatewayId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.beyondcorp.appgateways.v1.AppGateway appGateway_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder> + appGatewayBuilder_; + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appGateway field is set. + */ + public boolean hasAppGateway() { + return appGatewayBuilder_ != null || appGateway_ != null; + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appGateway. + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateway() { + if (appGatewayBuilder_ == null) { + return appGateway_ == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance() + : appGateway_; + } else { + return appGatewayBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppGateway(com.google.cloud.beyondcorp.appgateways.v1.AppGateway value) { + if (appGatewayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appGateway_ = value; + onChanged(); + } else { + appGatewayBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAppGateway( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder builderForValue) { + if (appGatewayBuilder_ == null) { + appGateway_ = builderForValue.build(); + onChanged(); + } else { + appGatewayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAppGateway(com.google.cloud.beyondcorp.appgateways.v1.AppGateway value) { + if (appGatewayBuilder_ == null) { + if (appGateway_ != null) { + appGateway_ = + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.newBuilder(appGateway_) + .mergeFrom(value) + .buildPartial(); + } else { + appGateway_ = value; + } + onChanged(); + } else { + appGatewayBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAppGateway() { + if (appGatewayBuilder_ == null) { + appGateway_ = null; + onChanged(); + } else { + appGateway_ = null; + appGatewayBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder getAppGatewayBuilder() { + + onChanged(); + return getAppGatewayFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder getAppGatewayOrBuilder() { + if (appGatewayBuilder_ != null) { + return appGatewayBuilder_.getMessageOrBuilder(); + } else { + return appGateway_ == null + ? com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance() + : appGateway_; + } + } + /** + * + * + *
+     * Required. A BeyondCorp AppGateway resource.
+     * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder> + getAppGatewayFieldBuilder() { + if (appGatewayBuilder_ == null) { + appGatewayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder>( + getAppGateway(), getParentForChildren(), isClean()); + appGateway_ = null; + } + return appGatewayBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + 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.beyondcorp.appgateways.v1.CreateAppGatewayRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) + private static final com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAppGatewayRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAppGatewayRequest(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.beyondcorp.appgateways.v1.CreateAppGatewayRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequestOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequestOrBuilder.java new file mode 100644 index 000000000000..9699f9aabe9f --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/CreateAppGatewayRequestOrBuilder.java @@ -0,0 +1,187 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface CreateAppGatewayRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.CreateAppGatewayRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource project name of the AppGateway location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource project name of the AppGateway location using the
+   * form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. User-settable AppGateway resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appGatewayId. + */ + java.lang.String getAppGatewayId(); + /** + * + * + *
+   * Optional. User-settable AppGateway resource ID.
+   *  * Must start with a letter.
+   *  * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
+   *  * Must end with a number or a letter.
+   * 
+ * + * string app_gateway_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appGatewayId. + */ + com.google.protobuf.ByteString getAppGatewayIdBytes(); + + /** + * + * + *
+   * Required. A BeyondCorp AppGateway resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the appGateway field is set. + */ + boolean hasAppGateway(); + /** + * + * + *
+   * Required. A BeyondCorp AppGateway resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The appGateway. + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateway(); + /** + * + * + *
+   * Required. A BeyondCorp AppGateway resource.
+   * 
+ * + * + * .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateway = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder getAppGatewayOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequest.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequest.java new file mode 100644 index 000000000000..ed11d8449e15 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequest.java @@ -0,0 +1,1014 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.DeleteAppGateway.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest} + */ +public final class DeleteAppGatewayRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) + DeleteAppGatewayRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAppGatewayRequest.newBuilder() to construct. + private DeleteAppGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAppGatewayRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAppGatewayRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAppGatewayRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 24: + { + validateOnly_ = input.readBool(); + 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * 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; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest other = + (com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.DeleteAppGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest.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_ = ""; + + requestId_ = ""; + + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_DeleteAppGatewayRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest build() { + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest result = + new com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + result.validateOnly_ = validateOnly_; + 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) { + return mergeFrom( + (com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and t
+     * he request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, validates request by executing a dry-run which would not
+     * alter the resource in any way.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + 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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) + private static final com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAppGatewayRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAppGatewayRequest(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.beyondcorp.appgateways.v1.DeleteAppGatewayRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequestOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequestOrBuilder.java new file mode 100644 index 000000000000..7f0c3265d2d7 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/DeleteAppGatewayRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface DeleteAppGatewayRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.DeleteAppGatewayRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and t
+   * he request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * Optional. If set, validates request by executing a dry-run which would not
+   * alter the resource in any way.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequest.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequest.java new file mode 100644 index 000000000000..1ef4e5ff47e5 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequest.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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.GetAppGateway.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest} + */ +public final class GetAppGatewayRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) + GetAppGatewayRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAppGatewayRequest.newBuilder() to construct. + private GetAppGatewayRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAppGatewayRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAppGatewayRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAppGatewayRequest( + 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * 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.beyondcorp.appgateways.v1.GetAppGatewayRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest other = + (com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) 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.beyondcorp.appgateways.v1.GetAppGatewayRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest 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.beyondcorp.appgateways.v1.GetAppGatewayRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest 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.beyondcorp.appgateways.v1.GetAppGatewayRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest 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.beyondcorp.appgateways.v1.GetAppGatewayRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest 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.beyondcorp.appgateways.v1.GetAppGatewayRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest 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.beyondcorp.appgateways.v1.GetAppGatewayRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.GetAppGateway.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.Builder.class); + } + + // Construct using com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_GetAppGatewayRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest build() { + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest result = + new com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest(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.beyondcorp.appgateways.v1.GetAppGatewayRequest) { + return mergeFrom((com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest.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.beyondcorp.appgateways.v1.GetAppGatewayRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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. BeyondCorp AppGateway name using the form:
+     * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+     * 
+ * + * + * 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.beyondcorp.appgateways.v1.GetAppGatewayRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) + private static final com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAppGatewayRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAppGatewayRequest(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.beyondcorp.appgateways.v1.GetAppGatewayRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequestOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequestOrBuilder.java new file mode 100644 index 000000000000..f6684db0fff2 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/GetAppGatewayRequestOrBuilder.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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface GetAppGatewayRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.GetAppGatewayRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. BeyondCorp AppGateway name using the form:
+   * `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`
+   * 
+ * + * + * 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/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequest.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequest.java new file mode 100644 index 000000000000..2f9692d0b187 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequest.java @@ -0,0 +1,1344 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * Request message for BeyondCorp.ListAppGateways.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest} + */ +public final class ListAppGatewaysRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) + ListAppGatewaysRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAppGatewaysRequest.newBuilder() to construct. + private ListAppGatewaysRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAppGatewaysRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAppGatewaysRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAppGatewaysRequest( + 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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = 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.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the AppGateway location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * 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 resource name of the AppGateway location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * 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_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * If not specified, a default value of 50 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to
+   * determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppGatewaysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppGatewaysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest other = + (com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest + 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for BeyondCorp.ListAppGateways.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.class, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.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_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest build() { + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest result = + new com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest) { + return mergeFrom((com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the AppGateway location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource name of the AppGateway location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource name of the AppGateway location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource name of the AppGateway location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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 resource name of the AppGateway location using the form:
+     * `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to
+     * determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to
+     * determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * If not specified, a default value of 50 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to
+     * determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppGatewaysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppGatewaysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppGatewaysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppGatewaysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous
+     * ListAppGatewaysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter specifying constraints of a list operation.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results. See
+     * [Sorting
+     * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+     * for more information.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = 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.beyondcorp.appgateways.v1.ListAppGatewaysRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) + private static final com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAppGatewaysRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAppGatewaysRequest(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.beyondcorp.appgateways.v1.ListAppGatewaysRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequestOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequestOrBuilder.java new file mode 100644 index 000000000000..b32d3146c1f7 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface ListAppGatewaysRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the AppGateway location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the AppGateway location using the form:
+   * `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * If not specified, a default value of 50 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to
+   * determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppGatewaysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous
+   * ListAppGatewaysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter specifying constraints of a list operation.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results. See
+   * [Sorting
+   * order](https://cloud.google.com/apis/design/design_patterns#sorting_order)
+   * for more information.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponse.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponse.java new file mode 100644 index 000000000000..4a9c17bcca3e --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponse.java @@ -0,0 +1,1441 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +/** + * + * + *
+ * Response message for BeyondCorp.ListAppGateways.
+ * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse} + */ +public final class ListAppGatewaysResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) + ListAppGatewaysResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAppGatewaysResponse.newBuilder() to construct. + private ListAppGatewaysResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAppGatewaysResponse() { + appGateways_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAppGatewaysResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAppGatewaysResponse( + 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)) { + appGateways_ = + new java.util.ArrayList< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway>(); + mutable_bitField0_ |= 0x00000001; + } + appGateways_.add( + input.readMessage( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.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)) { + appGateways_ = java.util.Collections.unmodifiableList(appGateways_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse.class, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse.Builder.class); + } + + public static final int APP_GATEWAYS_FIELD_NUMBER = 1; + private java.util.List appGateways_; + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + @java.lang.Override + public java.util.List + getAppGatewaysList() { + return appGateways_; + } + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + @java.lang.Override + public java.util.List + getAppGatewaysOrBuilderList() { + return appGateways_; + } + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + @java.lang.Override + public int getAppGatewaysCount() { + return appGateways_.size(); + } + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateways(int index) { + return appGateways_.get(index); + } + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder getAppGatewaysOrBuilder( + int index) { + return appGateways_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < appGateways_.size(); i++) { + output.writeMessage(1, appGateways_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < appGateways_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, appGateways_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.beyondcorp.appgateways.v1.ListAppGatewaysResponse)) { + return super.equals(obj); + } + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse other = + (com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) obj; + + if (!getAppGatewaysList().equals(other.getAppGatewaysList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getAppGatewaysCount() > 0) { + hash = (37 * hash) + APP_GATEWAYS_FIELD_NUMBER; + hash = (53 * hash) + getAppGatewaysList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for BeyondCorp.ListAppGateways.
+   * 
+ * + * Protobuf type {@code google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse.class, + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse.Builder.class); + } + + // Construct using + // com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAppGatewaysFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (appGatewaysBuilder_ == null) { + appGateways_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + appGatewaysBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.beyondcorp.appgateways.v1.AppGatewaysServiceProto + .internal_static_google_cloud_beyondcorp_appgateways_v1_ListAppGatewaysResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + getDefaultInstanceForType() { + return com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse build() { + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse buildPartial() { + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse result = + new com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse(this); + int from_bitField0_ = bitField0_; + if (appGatewaysBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + appGateways_ = java.util.Collections.unmodifiableList(appGateways_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.appGateways_ = appGateways_; + } else { + result.appGateways_ = appGatewaysBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse) { + return mergeFrom( + (com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse other) { + if (other + == com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + .getDefaultInstance()) return this; + if (appGatewaysBuilder_ == null) { + if (!other.appGateways_.isEmpty()) { + if (appGateways_.isEmpty()) { + appGateways_ = other.appGateways_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAppGatewaysIsMutable(); + appGateways_.addAll(other.appGateways_); + } + onChanged(); + } + } else { + if (!other.appGateways_.isEmpty()) { + if (appGatewaysBuilder_.isEmpty()) { + appGatewaysBuilder_.dispose(); + appGatewaysBuilder_ = null; + appGateways_ = other.appGateways_; + bitField0_ = (bitField0_ & ~0x00000001); + appGatewaysBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAppGatewaysFieldBuilder() + : null; + } else { + appGatewaysBuilder_.addAllMessages(other.appGateways_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.beyondcorp.appgateways.v1.ListAppGatewaysResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List appGateways_ = + java.util.Collections.emptyList(); + + private void ensureAppGatewaysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + appGateways_ = + new java.util.ArrayList( + appGateways_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder> + appGatewaysBuilder_; + + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public java.util.List + getAppGatewaysList() { + if (appGatewaysBuilder_ == null) { + return java.util.Collections.unmodifiableList(appGateways_); + } else { + return appGatewaysBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public int getAppGatewaysCount() { + if (appGatewaysBuilder_ == null) { + return appGateways_.size(); + } else { + return appGatewaysBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateways(int index) { + if (appGatewaysBuilder_ == null) { + return appGateways_.get(index); + } else { + return appGatewaysBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder setAppGateways( + int index, com.google.cloud.beyondcorp.appgateways.v1.AppGateway value) { + if (appGatewaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppGatewaysIsMutable(); + appGateways_.set(index, value); + onChanged(); + } else { + appGatewaysBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder setAppGateways( + int index, com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder builderForValue) { + if (appGatewaysBuilder_ == null) { + ensureAppGatewaysIsMutable(); + appGateways_.set(index, builderForValue.build()); + onChanged(); + } else { + appGatewaysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder addAppGateways(com.google.cloud.beyondcorp.appgateways.v1.AppGateway value) { + if (appGatewaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppGatewaysIsMutable(); + appGateways_.add(value); + onChanged(); + } else { + appGatewaysBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder addAppGateways( + int index, com.google.cloud.beyondcorp.appgateways.v1.AppGateway value) { + if (appGatewaysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAppGatewaysIsMutable(); + appGateways_.add(index, value); + onChanged(); + } else { + appGatewaysBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder addAppGateways( + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder builderForValue) { + if (appGatewaysBuilder_ == null) { + ensureAppGatewaysIsMutable(); + appGateways_.add(builderForValue.build()); + onChanged(); + } else { + appGatewaysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder addAppGateways( + int index, com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder builderForValue) { + if (appGatewaysBuilder_ == null) { + ensureAppGatewaysIsMutable(); + appGateways_.add(index, builderForValue.build()); + onChanged(); + } else { + appGatewaysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder addAllAppGateways( + java.lang.Iterable + values) { + if (appGatewaysBuilder_ == null) { + ensureAppGatewaysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, appGateways_); + onChanged(); + } else { + appGatewaysBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder clearAppGateways() { + if (appGatewaysBuilder_ == null) { + appGateways_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + appGatewaysBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public Builder removeAppGateways(int index) { + if (appGatewaysBuilder_ == null) { + ensureAppGatewaysIsMutable(); + appGateways_.remove(index); + onChanged(); + } else { + appGatewaysBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder getAppGatewaysBuilder( + int index) { + return getAppGatewaysFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder getAppGatewaysOrBuilder( + int index) { + if (appGatewaysBuilder_ == null) { + return appGateways_.get(index); + } else { + return appGatewaysBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public java.util.List + getAppGatewaysOrBuilderList() { + if (appGatewaysBuilder_ != null) { + return appGatewaysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(appGateways_); + } + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder addAppGatewaysBuilder() { + return getAppGatewaysFieldBuilder() + .addBuilder(com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance()); + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder addAppGatewaysBuilder( + int index) { + return getAppGatewaysFieldBuilder() + .addBuilder( + index, com.google.cloud.beyondcorp.appgateways.v1.AppGateway.getDefaultInstance()); + } + /** + * + * + *
+     * A list of BeyondCorp AppGateways in the project.
+     * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + public java.util.List + getAppGatewaysBuilderList() { + return getAppGatewaysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder> + getAppGatewaysFieldBuilder() { + if (appGatewaysBuilder_ == null) { + appGatewaysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.beyondcorp.appgateways.v1.AppGateway, + com.google.cloud.beyondcorp.appgateways.v1.AppGateway.Builder, + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder>( + appGateways_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + appGateways_ = null; + } + return appGatewaysBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.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.beyondcorp.appgateways.v1.ListAppGatewaysResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) + private static final com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse(); + } + + public static com.google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAppGatewaysResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAppGatewaysResponse(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.beyondcorp.appgateways.v1.ListAppGatewaysResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponseOrBuilder.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponseOrBuilder.java new file mode 100644 index 000000000000..b30c12f087ff --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/ListAppGatewaysResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * 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/beyondcorp/appgateways/v1/app_gateways_service.proto + +package com.google.cloud.beyondcorp.appgateways.v1; + +public interface ListAppGatewaysResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.beyondcorp.appgateways.v1.ListAppGatewaysResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + java.util.List getAppGatewaysList(); + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGateway getAppGateways(int index); + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + int getAppGatewaysCount(); + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + java.util.List + getAppGatewaysOrBuilderList(); + /** + * + * + *
+   * A list of BeyondCorp AppGateways in the project.
+   * 
+ * + * repeated .google.cloud.beyondcorp.appgateways.v1.AppGateway app_gateways = 1; + */ + com.google.cloud.beyondcorp.appgateways.v1.AppGatewayOrBuilder getAppGatewaysOrBuilder(int index); + + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * A list of locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/LocationName.java b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/v1/LocationName.java new file mode 100644 index 000000000000..ad6b0d81aca1 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/java/com/google/cloud/beyondcorp/appgateways/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.beyondcorp.appgateways.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/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/proto/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/proto/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto new file mode 100644 index 000000000000..605a9354e032 --- /dev/null +++ b/java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/src/main/proto/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto @@ -0,0 +1,356 @@ +// 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.beyondcorp.appgateways.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BeyondCorp.AppGateways.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/beyondcorp/appgateways/v1;appgateways"; +option java_multiple_files = true; +option java_outer_classname = "AppGatewaysServiceProto"; +option java_package = "com.google.cloud.beyondcorp.appgateways.v1"; +option php_namespace = "Google\\Cloud\\BeyondCorp\\AppGateways\\V1"; +option ruby_package = "Google::Cloud::BeyondCorp::AppGateways::V1"; + +// ## API Overview +// +// The `beyondcorp.googleapis.com` service implements the Google Cloud +// BeyondCorp API. +// +// ## Data Model +// +// The AppGatewaysService exposes the following resources: +// +// * AppGateways, named as follows: +// `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}`. +// +// The AppGatewaysService service provides methods to manage +// (create/read/update/delete) BeyondCorp AppGateways. +service AppGatewaysService { + option (google.api.default_host) = "beyondcorp.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists AppGateways in a given project and location. + rpc ListAppGateways(ListAppGatewaysRequest) + returns (ListAppGatewaysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/appGateways" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single AppGateway. + rpc GetAppGateway(GetAppGatewayRequest) returns (AppGateway) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/appGateways/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new AppGateway in a given project and location. + rpc CreateAppGateway(CreateAppGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/appGateways" + body: "app_gateway" + }; + option (google.api.method_signature) = "parent,app_gateway,app_gateway_id"; + option (google.longrunning.operation_info) = { + response_type: "AppGateway" + metadata_type: "AppGatewayOperationMetadata" + }; + } + + // Deletes a single AppGateway. + rpc DeleteAppGateway(DeleteAppGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/appGateways/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AppGatewayOperationMetadata" + }; + } +} + +// Request message for BeyondCorp.ListAppGateways. +message ListAppGatewaysRequest { + // Required. The resource name of the AppGateway location using the form: + // `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/AppGateway" + } + ]; + + // Optional. The maximum number of items to return. + // If not specified, a default value of 50 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][BeyondCorp.ListAppGatewaysResponse.next_page_token] to + // determine if there are more instances left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous + // ListAppGatewaysRequest, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter specifying constraints of a list operation. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results. See + // [Sorting + // order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + // for more information. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for BeyondCorp.ListAppGateways. +message ListAppGatewaysResponse { + // A list of BeyondCorp AppGateways in the project. + repeated AppGateway app_gateways = 1; + + // A token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // A list of locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for BeyondCorp.GetAppGateway. +message GetAppGatewayRequest { + // Required. BeyondCorp AppGateway name using the form: + // `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/AppGateway" + } + ]; +} + +// Request message for BeyondCorp.CreateAppGateway. +message CreateAppGatewayRequest { + // Required. The resource project name of the AppGateway location using the + // form: `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "beyondcorp.googleapis.com/AppGateway" + } + ]; + + // Optional. User-settable AppGateway resource ID. + // * Must start with a letter. + // * Must contain between 4-63 characters from `/[a-z][0-9]-/`. + // * Must end with a number or a letter. + string app_gateway_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A BeyondCorp AppGateway resource. + AppGateway app_gateway = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validates request by executing a dry-run which would not + // alter the resource in any way. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for BeyondCorp.DeleteAppGateway. +message DeleteAppGatewayRequest { + // Required. BeyondCorp AppGateway name using the form: + // `projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "beyondcorp.googleapis.com/AppGateway" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validates request by executing a dry-run which would not + // alter the resource in any way. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A BeyondCorp AppGateway resource represents a BeyondCorp protected AppGateway +// to a remote application. It creates all the necessary GCP components needed +// for creating a BeyondCorp protected AppGateway. Multiple connectors can be +// authorised for a single AppGateway. +message AppGateway { + option (google.api.resource) = { + type: "beyondcorp.googleapis.com/AppGateway" + pattern: "projects/{project}/locations/{location}/appGateways/{app_gateway}" + }; + + // Allocated connection of the AppGateway. + message AllocatedConnection { + // Required. The PSC uri of an allocated connection + string psc_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ingress port of an allocated connection + int32 ingress_port = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Enum containing list of all possible network connectivity options + // supported by BeyondCorp AppGateway. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // TCP Proxy based BeyondCorp Connection. API will default to this if unset. + TCP_PROXY = 1; + } + + // Represents the different states of an AppGateway. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // AppGateway is being created. + CREATING = 1; + + // AppGateway has been created. + CREATED = 2; + + // AppGateway's configuration is being updated. + UPDATING = 3; + + // AppGateway is being deleted. + DELETING = 4; + + // AppGateway is down and may be restored in the future. + // This happens when CCFE sends ProjectState = OFF. + DOWN = 5; + } + + // Enum containing list of all possible host types supported by BeyondCorp + // Connection. + enum HostType { + // Default value. This value is unused. + HOST_TYPE_UNSPECIFIED = 0; + + // AppGateway hosted in a GCP regional managed instance group. + GCP_REGIONAL_MIG = 1; + } + + // Required. Unique resource name of the AppGateway. + // The name is ignored when creating an AppGateway. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the resource was last modified. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An arbitrary user-provided name for the AppGateway. Cannot exceed + // 64 characters. + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A unique identifier for the instance generated by the + // system. + string uid = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of network connectivity used by the AppGateway. + Type type = 7 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The current state of the AppGateway. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined URI for this resource. + string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of connections allocated for the Gateway + repeated AllocatedConnection allocated_connections = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of hosting used by the AppGateway. + HostType host_type = 11 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the metadata of the long-running operation. +message AppGatewayOperationMetadata { + // 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/java-beyondcorp-appgateways/renovate.json b/java-beyondcorp-appgateways/renovate.json new file mode 100644 index 000000000000..4fea03ae5e72 --- /dev/null +++ b/java-beyondcorp-appgateways/renovate.json @@ -0,0 +1,74 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-beyondcorp-appgateways", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis", + "^com.google.cloud:google-cloud-conformance-tests" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "dependencyDashboard": true +} diff --git a/java-beyondcorp-appgateways/samples/install-without-bom/pom.xml b/java-beyondcorp-appgateways/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..622ba54fb62a --- /dev/null +++ b/java-beyondcorp-appgateways/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + -install-without-bom + jar + Google BeyondCorp AppGateways Install Without Bom + https://github.com/googleapis/java-beyondcorp-appgateways + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-beyondcorp-appgateways/samples/pom.xml b/java-beyondcorp-appgateways/samples/pom.xml new file mode 100644 index 000000000000..b80a76918cdf --- /dev/null +++ b/java-beyondcorp-appgateways/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud--samples + 0.0.1-SNAPSHOT + pom + Google BeyondCorp AppGateways Samples Parent + https://github.com/googleapis/java-beyondcorp-appgateways + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + + true + + + + + diff --git a/java-beyondcorp-appgateways/samples/snapshot/pom.xml b/java-beyondcorp-appgateways/samples/snapshot/pom.xml new file mode 100644 index 000000000000..752c41345f7d --- /dev/null +++ b/java-beyondcorp-appgateways/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + -snapshot + jar + Google BeyondCorp AppGateways Snapshot Samples + https://github.com/googleapis/java-beyondcorp-appgateways + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.0 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-beyondcorp-appgateways/samples/snippets/pom.xml b/java-beyondcorp-appgateways/samples/snippets/pom.xml new file mode 100644 index 000000000000..381294b08843 --- /dev/null +++ b/java-beyondcorp-appgateways/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + -snippets + jar + Google BeyondCorp AppGateways Snippets + https://github.com/googleapis/java-beyondcorp-appgateways + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-beyondcorp-appgateways + 0.0.0 + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + diff --git a/java-beyondcorp-appgateways/versions.txt b/java-beyondcorp-appgateways/versions.txt new file mode 100644 index 000000000000..23f97981f674 --- /dev/null +++ b/java-beyondcorp-appgateways/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-beyondcorp-appgateways:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-beyondcorp-appgateways-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-beyondcorp-appgateways-v1:0.0.0:0.0.1-SNAPSHOT